CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-62MM-XWMV-CRHG

GHSA-62MM-XWMV-CRHG: Unauthenticated Path Traversal in Khoj Static File Serving Endpoint

Alon Barad
Alon Barad
Software Engineer

Sep 26, 2026·5 min read·27 visits

Executive Summary (TL;DR)

An unauthenticated path traversal flaw in Khoj enables remote attackers to read sensitive files, databases, and API keys by using directory traversal sequences on the static landing page file router.

An unauthenticated path traversal vulnerability exists in the Khoj AI assistant platform via the static file serving endpoint `/home/{file_path:path}`. Due to improper path sanitization when handling user input with Python's pathlib module, a remote attacker can read arbitrary files from the server's filesystem.

Vulnerability Overview

The application Khoj is an open-source, self-hosted AI research copilot designed to aggregate, index, and query personal documents, integrating closely with various Large Language Models (LLMs). To support its default landing interface, the application exposes a public, unauthenticated HTTP endpoint designated for serving static files.

A path traversal vulnerability (classified as CWE-22) resides within this public asset serving routine. Because the application fails to validate the boundaries of user-supplied paths, remote unauthenticated attackers can escape the intended static asset directory.

This security bypass allows the retrieval of sensitive system and application files. Successful exploitation does not require active sessions or specialized user interaction, placing all deployments directly exposed to the internet at immediate risk of data exposure.

Root Cause Analysis

The root cause of this vulnerability lies in the implementation of the /home/{file_path:path} endpoint within src/khoj/routers/web_client.py. This route employs FastAPI's wildcard path converter ({file_path:path}), which accepts arbitrary sub-paths, including directory traversal sequences such as ../ and forward slashes.

To resolve the local file path, the application uses the Python standard library's pathlib module. The router directly concatenates the hardcoded base landing page directory constants.home_directory with the raw, user-supplied file_path string using the pathlib division (/) operator.

While the pathlib.Path class structures paths logically, its division operator does not perform canonicalization or prevent relative references from navigating outside the parent directory. When the resulting un-normalized path is passed directly to Starlette's FileResponse object, the underlying operating system resolves the relative directory segments and retrieves the target file. No security middleware or access filters were present to validate that the resolved file remained inside the designated static root directory.

Code Analysis

The original vulnerable route in src/khoj/routers/web_client.py was implemented as follows:

@web_client.get("/home/{file_path:path}", response_class=FileResponse)
def home_static_files(file_path: str):
    """Serve static files from the home landing page directory"""
    # VULNERABLE: Direct concatenation of user input without sanitization or path resolution
    return FileResponse(constants.home_directory / file_path)

The remediation patch introduces validation using standard security patterns for Python's path handling:

@web_client.get("/home/{file_path:path}", response_class=FileResponse)
def home_static_files(file_path: str):
    """Serve static files from the home landing page directory"""
    # FIXED: Fully resolve the path, evaluating symlinks and stripping relative sequences
    resolved = (constants.home_directory / file_path).resolve()
    
    # FIXED: Verify that the resolved absolute path remains within the base directory boundaries
    if not resolved.is_relative_to(constants.home_directory.resolve()):
        raise HTTPException(status_code=404)
    return FileResponse(resolved)

By adding the .resolve() method call, the system resolves any symbolic links and strips out redundant relative directory path elements. The addition of is_relative_to() acts as a strong logical containment check, ensuring that any resolution resulting in a location outside of the base directory is immediately aborted with an HTTP 404 error.

Exploitation Methodology

Exploitation of this vulnerability requires only network-level access to the running Khoj instance. Because the endpoint does not perform any session or identity verification, an attacker can directly submit malformed GET requests to extract targeted system files.

In a standard Linux deployment environment, an attacker can construct directory traversal payloads designed to escape the web root folder. By utilizing multiple URL-encoded or raw ../ sequences, the file system boundary is bypassed.

An example attack request targeting /etc/passwd appears as follows:

GET /home/../../../../../../../../../../../../etc/passwd HTTP/1.1
Host: target-khoj-instance:8000
Connection: close

When processed, the backend concatenates this payload with the internal path. The OS evaluates this to /etc/passwd and returns the target file's content in a 200 OK response. Beyond operating system configuration files, attackers can specifically target application-specific assets. This includes the internal SQLite database (khoj.db) which contains private user document indices and plain-text API credentials.

Impact Assessment

The impact of this path traversal vulnerability is evaluated as High. Due to the nature of Khoj as a personal AI assistant, compromised instances expose extremely sensitive data assets.

Attackers can download the application database, which typically holds indexed local documents, proprietary enterprise notes, and private communication histories. This represents a complete breach of confidentiality for self-hosted instances containing sensitive personal or organizational information.

Furthermore, the configuration files often store active third-party API tokens for services like OpenAI, Anthropic, Gemini, and Deepseek. Exfiltration of these tokens can result in financial loss, API rate limit exhaustion, and potential secondary compromises of connected cloud ecosystems.

Remediation and Defense-in-Depth

To fully address this vulnerability, administrators must upgrade their Khoj deployments to version 2.0.0-beta.25 or higher. This version natively integrates secure path resolution and containment checking.

If immediate patching is not possible, system administrators should deploy restrictive rules on reverse proxies or web application firewalls (WAFs). Ingress traffic filters can block requests directed to /home/ that contain dot-dot-slash patterns or equivalent hexadecimal encodings.

As a secure deployment practice, ensure the Khoj application runs within an isolated environment under a dedicated, low-privilege system user account. Limiting the execution account's filesystem read permissions ensures that even if a path traversal vulnerability is exploited, the attacker's visibility is confined only to non-critical files.

Official Patches

khoj-aiFix commit implementing safe path resolution and boundary verification

Fix Analysis (2)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Affected Systems

Khoj AI Assistant Deployments running versions >= 2.0.0-beta.20 and < 2.0.0-beta.25

Affected Versions Detail

Product
Affected Versions
Fixed Version
khoj
khoj-ai
>= 2.0.0-beta.20, < 2.0.0-beta.252.0.0-beta.25
AttributeDetail
CWE IDCWE-22 (Path Traversal)
Attack VectorNetwork
CVSS v3.1 Score7.5 (High)
Exploit StatusPoC Available
KEV StatusNot Listed
Mitigated Version2.0.0-beta.25

MITRE ATT&CK Mapping

T1083File and Directory Discovery
Discovery
T1552Unsecured Credentials
Credential Access
T1212Exploitation for Credential Access
Credential Access
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The software uses external input to construct a pathname that is intended to identify a file or directory that is located under a restricted directory, but the software does not properly neutralize special elements within the pathname.

Known Exploits & Detection

GitHub Advisory DatabaseOfficial advisory with detailed vulnerability description and remediation commit reference.

Vulnerability Timeline

Vulnerability introduced via commit 9801ffd2de642772f072ca496032b7c352013b6a
2025-12-29
Vulnerability remediated via commit 21c51b9ace4eb59ce79ac0a93b917289824195cf
2026-02-22
Secure release tag 2.0.0-beta.25 distributed
2026-02-22
Security Advisory GHSA-62MM-XWMV-CRHG published
2026-02-22

References & Sources

  • [1]GitHub Advisory GHSA-62MM-XWMV-CRHG
  • [2]Remediation Commit
  • [3]Introduction Commit
  • [4]Khoj 2.0.0-beta.25 Release

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•37 minutes ago•CVE-2026-88982
5.4

CVE-2026-88982: Cross-Tenant Execution Cache Poisoning and Output Substitution in Kubeflow Pipelines

CVE-2026-88982 (GHSA-2xwh-426q-42c5) is an authorization bypass and data integrity vulnerability affecting Kubeflow Pipelines versions prior to 2.18.0. The flaw resides in the legacy V1 and raw-Argo execution caching mutating admission webhook and the associated cache-server storage backend. In multi-tenant deployments where namespaces share a centralized cache service, execution cache keys were derived solely from container specification fields without incorporating the workload's Kubernetes namespace. Additionally, the cache watcher trusted mutable pod annotations when persisting execution outputs. Consequently, an authenticated user with workload submission privileges in one tenant namespace can poison cached step outputs consumed by other tenants or read cached outputs generated by workloads in separate namespaces.

Amit Schendel
Amit Schendel
2 views•12 min read
•about 2 hours ago•CVE-2026-88983
5.0

CVE-2026-88983: Authenticated Server-Side Request Forgery in Kubeflow Pipelines API Server

CVE-2026-88983 is an authenticated Server-Side Request Forgery (SSRF) vulnerability affecting the Kubeflow Pipelines API server in versions prior to 2.17.0. When an authenticated user creates a pipeline or pipeline version using a remote specification URI, the backend server retrieves the document via Go's default HTTP client without validating the target scheme, hostname, port, or IP address. Because the API server reflects remote connection errors and HTTP status codes in its response, an attacker with pipeline creation permissions can exploit the server as a status-code and port-scanning oracle against Kubernetes cluster-internal services, private networks, and cloud metadata endpoints.

Amit Schendel
Amit Schendel
3 views•11 min read
•about 3 hours ago•CVE-2026-88985
6.5

CVE-2026-88985: SQL Injection via Pagination Token Deserialization and Metric Sorting in Kubeflow Pipelines API Server

CVE-2026-88985 is a SQL injection vulnerability (CWE-89) in the Kubeflow Pipelines (KFP) API server prior to version 2.17.0. The flaw stems from the untrusted deserialization of base64-encoded JSON pagination tokens (page_token) and the direct concatenation of metric names during run list sorting. Authenticated users with permissions to invoke REST or gRPC list endpoints can inject arbitrary SQL syntax into structural query identifiers and JOIN predicates, enabling unauthorized cross-tenant read access to all database records accessible by the API server.

Alon Barad
Alon Barad
2 views•10 min read
•about 4 hours ago•CVE-2026-88986
6.1

CVE-2026-88986: Reflected Cross-Site Scripting in Kubeflow Pipelines Frontend Error Responses

A reflected Cross-Site Scripting (XSS) vulnerability exists in the Kubeflow Pipelines frontend server prior to version 2.15.0. Specifically, the Express route handlers for '/pipeline/k8s/pod' and '/pipeline/k8s/pod/events' reflect unvalidated 'podname' and 'podnamespace' query parameters, along with backend Kubernetes API error messages, directly into HTML-capable HTTP error responses. An unauthenticated attacker can exploit this flaw by convincing an authenticated user to visit a crafted URL, resulting in arbitrary JavaScript execution within the context of the Kubeflow Pipelines frontend origin.

Alon Barad
Alon Barad
5 views•10 min read
•about 5 hours ago•CVE-2026-88984
7.2

CVE-2026-88984: RBAC Authorization Bypass in Kubeflow Pipelines Multi-User API Server

CVE-2026-88984 (GHSA-ghgh-57qv-h687) is an incorrect authorization vulnerability affecting Kubeflow Pipelines (KFP) prior to version 2.16.1 in multi-user deployments. The multi-user API server treats the empty Kubernetes namespace associated with shared or global pipelines as an unconditional authorization exception across all API verbs. Consequently, any authenticated user can modify, overwrite, or delete shared pipeline definitions and pipeline versions without possessing the required Kubernetes RBAC permissions, compromising the integrity and availability of global machine learning workflows.

Amit Schendel
Amit Schendel
5 views•10 min read
•about 6 hours ago•CVE-2026-102340
8.5

CVE-2026-102340: Missing Authentication and Authorization in Telepresence Traffic Manager gRPC API

Prior to version 2.31.0, the Telepresence Traffic Manager exposed an unauthenticated gRPC API on cluster-internal port 8081 that lacked caller identity verification and Kubernetes RBAC authorization checks. An attacker operating any pod with network access to the Traffic Manager can register a session in an arbitrary managed namespace, establish service intercepts, redirect live production traffic, and exfiltrate the complete container environment of victim workloads, including mounted secrets and service account tokens.

Amit Schendel
Amit Schendel
5 views•10 min read