<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:webfeeds="http://webfeeds.org/rss/1.0"><channel><title>Khoj (2.0.0-Beta.23 - 2.0.0-Beta.24) - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/khoj-2.0.0-beta.23---2.0.0-beta.24/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Sat, 26 Sep 2026 02:07:27 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/khoj-2.0.0-beta.23---2.0.0-beta.24/feed.xml" rel="self" type="application/rss+xml"/><image><url>https://feed.craftedsignal.io/favicon-32x32.png</url><title>CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/</link><width>32</width><height>32</height></image><webfeeds:icon>https://feed.craftedsignal.io/favicon.svg</webfeeds:icon><item><title>Unauthenticated Path Traversal in Khoj</title><link>https://feed.craftedsignal.io/briefs/2026-09-khoj-path-traversal/</link><pubDate>Sat, 26 Sep 2026 02:07:27 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-09-khoj-path-traversal/</guid><description>An unauthenticated path traversal vulnerability in the Khoj /home/ endpoint allows remote attackers to read arbitrary files from the server filesystem.</description><content:encoded><![CDATA[<p>The Khoj application contains an unauthenticated path traversal vulnerability within the /home/ endpoint, defined in 'src/khoj/routers/web_client.py'. This endpoint is intended to serve static files from a specific directory but fails to perform path normalization or validation before resolving user-supplied input. An attacker can append directory traversal sequences (such as ../) to the URI to escape the intended directory and access sensitive files on the host filesystem. Because the endpoint lacks authentication decorators, exploitation is possible by any unauthenticated attacker with network access to the Khoj instance. This flaw affects Khoj versions from 2.0.0-beta.23 to 2.0.0-beta.25.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker performs network reconnaissance to identify a reachable Khoj instance.</li>
<li>Attacker interacts with the /home/ endpoint via an HTTP GET request.</li>
<li>Attacker crafts a malicious URI containing path traversal sequences (e.g., ../../../etc/passwd).</li>
<li>The application logic in 'web_client.py' concatenates the malicious path to the base directory without validation.</li>
<li>The underlying operating system resolves the traversal sequences to a target file path outside the web directory.</li>
<li>The 'FileResponse' object retrieves the content of the unintended file.</li>
<li>The application returns the contents of the requested file in the HTTP response body, leading to information disclosure.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows unauthenticated remote attackers to read any file on the server accessible to the application process. This includes sensitive data such as database credentials, API keys, application secrets (e.g., Django SECRET_KEY), and system-level files like '/etc/passwd' or '/proc/self/environ'. Access to these files can lead to complete service compromise, facilitate further lateral movement, or allow the attacker to gain persistent unauthorized access to the environment.</p>
<h2 id="recommendation">Recommendation</h2>
<ol>
<li>Upgrade to a version of Khoj patched against this vulnerability (&gt;= 2.0.0-beta.25).</li>
<li>Implement a WAF or reverse proxy rule to block or sanitize incoming HTTP requests containing directory traversal sequences (e.g., ../) in the /home/ URI path.</li>
<li>Apply the suggested code-level patch to 'src/khoj/routers/web_client.py' by adding path resolution and validation logic that verifies the requested file remains within the intended base directory.</li>
<li>Deploy the suggested Sigma rule to monitor for suspicious traversal patterns in web server logs.</li>
</ol>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>web-application-vulnerability</category><category>path-traversal</category><category>information-disclosure</category></item></channel></rss>