Khoj Has an Unauthenticated Path Traversal
Affects khojSource GCVE Database
CVSS 8.7 High : upgrade to 2.0.0-beta.25 soon.
Data as of 26 Sep 2026, 05:05 UTC
- Patch
- Available – fixed in 2.0.0-beta.25
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:NWhat to do
Upgrade khoj to 2.0.0-beta.25.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| PyPIkhoj | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available for this vulnerability. The recommended fix is to replace the custom file serving handler with FastAPI's StaticFiles mount or to add explicit path validation and normalization to ensure requested files reside within the intended directory. For example, resolving the requested path and verifying it is a subpath of the home directory before serving the file prevents path traversal. Applying the official patch or update to a fixed version is advised.
Description
The khoj application has an unauthenticated path traversal vulnerability in its /home/{file_path:path} endpoint. This endpoint serves static files by concatenating user input directly with a home directory path without any path traversal filtering, normalization, or authentication. An attacker can exploit this to read arbitrary files from the server filesystem, including sensitive configuration and system files.
References
- github.com/khoj-ai/khoj/security/advisories/GHSA-62mm-xwmv-crhg (opens in a new tab)
- github.com/khoj-ai/khoj/commit/21c51b9ace4eb59ce79ac0a93b917289824195cf (opens in a new tab)
- github.com/khoj-ai/khoj/commit/9801ffd2de642772f072ca496032b7c352013b6a (opens in a new tab)
- github.com/khoj-ai/khoj (opens in a new tab)
- github.com/khoj-ai/khoj/releases/tag/2.0.0-beta.25 (opens in a new tab)