Sep 23, 2026·6 min read·2 visits
Improper error handling in LightRAG's FastAPI server prior to version 1.5.5 permits unauthenticated network clients to leak highly sensitive infrastructure details, including absolute filesystem paths and database host parameters, by triggering raw exception traces.
CVE-2026-85709 is a sensitive information exposure vulnerability in HKUDS LightRAG prior to version 1.5.5. The vulnerability allows remote, unauthenticated clients to trigger server-side errors and receive raw Python exception details, including local filesystem paths, database connection strings, credentials, and internal system configurations.
LightRAG is an open-source retrieval-augmented generation framework designed to integrate knowledge graphs and large language models for advanced information retrieval tasks. The framework exposes a FastAPI-based server component to facilitate document ingestion, graph generation, querying, and backend model configuration. By default, this API server operates without an active authentication mechanism, permitting any network client to interact with the endpoints.
Prior to version 1.5.5, the application suffered from systemic improper exception handling across its core API routes. Under normal operations, failures in network connectivity, malformed inputs, or missing files would trigger backend Python exceptions. Instead of sanitizing these failures, the API routers returned the raw exceptions directly to the clients. This architecture creates a substantial information exposure surface.
The vulnerability is tracked as CVE-2026-85709 and GHSA-hrmj-7rvj-4hg8, matching the CWE-209 classification (Generation of Error Message Containing Sensitive Information). The absolute exposure of traceback structures and connection variables lowers the technical barrier for attackers mapping the host environment, targeting database servers, or constructing secondary exploitation chains.
The root cause of CVE-2026-85709 is the widespread implementation of generic catch-all try-except structures that directly reflect system error states to HTTP responses. Specifically, across approximately 31 endpoints in modules such as document_routes.py, graph_routes.py, and query_routes.py, the developers utilized a standardized error handling pattern. This pattern caught all exceptions using except Exception as e and threw a FastAPI HTTPException with detail=str(e).
When Python serializes exceptions to string formats, the resulting string typically includes context-specific details. In the context of database drivers (such as PostgreSQL's asyncpg, MongoDB's pymongo, or Neo4j drivers), an exception caused by a failed connection, timeout, or authentication failure frequently contains sensitive configuration parameters. This metadata can include backend hostname values, internal port numbers, username strings, and database schemas.
Because the endpoints do not perform pre-execution validation or sanitize outbound error details, any backend failure exposes the internal running context. The lack of standard exception translation layers allowed operational driver failures to bypass administrative visibility and propagate raw diagnostic records directly to untrusted web clients.
The vulnerability was distributed across multiple router files. The following example demonstrates the pre-patch vulnerability structure within the document uploading route:
# Pre-patch vulnerable pattern in lightrag/api/routers/document_routes.py
@router.post("/documents/upload")
async def upload_document(file: UploadFile = File(...)):
try:
# Ingestion logic executed here
await process_document_ingestion(file)
except Exception as e:
logger.error(f"Error /documents/upload: {file.filename}: {str(e)}")
logger.error(traceback.format_exc())
# VULNERABLE: Stringified exception 'str(e)' is returned to client
raise HTTPException(status_code=500, detail=str(e))In version 1.5.5, the maintainers implemented a two-tier remediation strategy. The primary defense introduces a centralized sanitization helper function within lightrag/api/utils_api.py. This helper captures the exception, logs the details securely on the server, generates a randomized 12-character hexadecimal correlation ID, and returns a generic client-safe HTTP response.
# Defensive mitigation helper in lightrag/api/utils_api.py
import uuid
from fastapi import HTTPException
_INTERNAL_SERVER_ERROR_MESSAGE = "Internal server error"
def internal_server_error(exc: Exception) -> HTTPException:
# Generate a unique correlation ID for server-side log auditing
error_id = uuid.uuid4().hex[:12]
logger.error(
f"Returning HTTP 500 to client [error_id={error_id}] ({type(exc).__name__})"
)
# Return generic error details and ID, completely hiding the exception string
return HTTPException(
status_code=500,
detail=f"{_INTERNAL_SERVER_ERROR_MESSAGE} (error_id: {error_id})",
)All endpoint modules were refactored to replace raise HTTPException(status_code=500, detail=str(e)) with raise internal_server_error(e). To ensure complete defensive coverage, a last-resort global exception handler was registered within lightrag_server.py. This handler intercepts any uncaught runtime exceptions that escape standard router handlers, preventing the underlying ASGI server from disclosing unhandled stack trace frames.
Exploitation of CVE-2026-85709 is straightforward because it does not require authentication or complex state preparation. The attacker's objective is to systematically induce server-side exceptions and parse the reflected response structures.
Common exploitation vectors include:
/documents/upload to trigger file-parsing or driver-level insertion failures.When a connection or operational error is successfully induced, the unpatched server returns an HTTP 500 response containing detailed traceback metadata. From this metadata, the attacker can extract local path definitions (e.g., /opt/lightrag/workspace/config.json), active database parameters, and internal Python library versions. These details are used to perform targeted external host profiling.
The overall severity of CVE-2026-85709 is classified as Medium, represented by a CVSS v3.1 score of 5.3 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N). The impact vector is limited to confidentiality. The vulnerability does not directly allow write access, system manipulation, or service disruption, which leaves the integrity and availability scores at none.
Despite the lack of direct control-flow hijacking, the exposure of internal execution parameters is a significant security risk. Retrieval-augmented generation platforms handle sensitive corporate data and interface directly with key internal datastores. Disclosing absolute directory paths and internal database credentials significantly assists attackers in targeting localized path traversal vulnerabilities or seeking lateral movement opportunities.
Furthermore, the disclosure of internal network topologies, system usernames, and configuration layouts provides the exact parameters required for offline credential brute-forcing and network scanning. This risk is amplified if the database driver prints raw authorization tokens or unredacted connection strings.
The primary remediation strategy is upgrading the LightRAG package to version 1.5.5 or later. This release enforces the sanitized generic exception structures globally and establishes the internal_server_error translation framework across all API modules.
For systems where immediate upgrades are not possible, administrators should apply the following secondary workarounds:
9621) using host-based firewalls, network security groups, or a reverse proxy. Limit API communication strictly to authorized internal hosts.LIGHTRAG_API_KEY environment variable configuration to block unauthenticated access across the entire API router structure.CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
LightRAG HKUDS | < 1.5.5 | 1.5.5 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-209 |
| Attack Vector | Network (AV:N) |
| CVSS v3.1 Score | 5.3 (Medium) |
| Exploit Status | No Public Exploits |
| Impact | Partial Confidentiality Leak |
| CISA KEV Status | Not Listed |
The product generates an error message that includes sensitive information about its environment, users, or associated data.
An authorization bypass vulnerability exists in Nautobot's REST API endpoints handling approval workflows. Due to an architectural inconsistency, a standalone, generic REST API endpoint for creating approval responses was exposed without propagating the required business-logic validations. This allows low-privileged authenticated users to submit forged, self-approved votes, bypassing approval thresholds and triggering unauthorized server-side automated jobs.
HKUDS LightRAG prior to version 1.5.5 is vulnerable to multiple timing side-channels (CWE-208) in its API authentication layer. The password verification logic in `lightrag/api/passwords.py` compares plaintext administrative credentials using Python's short-circuiting equality operator (`==`). Additionally, `lightrag/api/auth.py` terminates authentication early on non-existent usernames, creating an observable latency difference compared to computationally expensive bcrypt comparisons on valid accounts. Together, these allow remote unauthenticated attackers with low-latency network access to enumerate valid usernames and extract plaintext passwords character by character.
LightRAG prior to version 1.5.5 does not implement rate limiting, lockout mechanisms, or throttling on its `/login` authentication endpoint. This allows unauthenticated remote attackers to perform rapid brute-force attacks to crack passwords and hijack active sessions. Furthermore, because the endpoint processed synchronous bcrypt verifications inside an asynchronous event loop, concurrent brute-force requests can easily exhaust server CPU resources, triggering an unauthenticated Denial of Service (DoS).
A security vulnerability in HKUDS/LightRAG prior to v1.5.5 allows authenticated attackers to bypass the native markdown image downloader guard. The system fails to normalize IPv6 transition wrappers (such as NAT64, IPv4-compatible, and 6to4 blocks) encapsulating internal IPv4 addresses. Python's ipaddress library evaluates these wrappers as globally routable, but hosting environments running NAT64/DNS64 routing decapsulate and route the requests to internal resources.
HKUDS LightRAG, an open-source retrieval-augmented generation (RAG) framework, is vulnerable to Stored Cross-Site Scripting (XSS) in its WebUI chat rendering component prior to version 1.5.5. Unsanitized document content ingested into the vector database can propagate through the LLM response pipeline and execute malicious HTML or active JavaScript payloads inside the administrator's WebUI session. Because the application stores sensitive access keys in browser storage, successful exploitation allows complete API token extraction and administrative session hijacking.
An Insecure Direct Object Reference (IDOR) vulnerability exists in Spree open-source e-commerce solution versions 5.4.0 through 5.4.3 and 5.5.0 through 5.5.3. An authenticated attacker can predict or enumerate guest cart identifiers generated via Sqids and associate them with their own account. This unauthorized association leaks sensitive customer personally identifiable information (PII) and disrupts the checkout flow of active guest sessions.