Skip to main content
VulnerabilityPublished

Khoj Has an Unauthenticated Path Traversal

Affects khojSource GCVE Database

0

CVSS 8.7 High : upgrade to 2.0.0-beta.25 soon.

Data as of 26 Sep 2026, 05:05 UTC

CVSS 4.0 base score
8.7High
How severe the flaw is on the 0–10 CVSS scale.
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:N

What to do

Upgrade khoj to 2.0.0-beta.25.

Affected software

ProductAffectedFixed in
PyPIkhojAffected
  • >=2.0.0-beta.23 <2.0.0-beta.25
Fixed in
  • 2.0.0-beta.25

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

Community reviews

Loading reviews…