LightRAG CORS Misconfiguration Allows Credentialed Cross-Origin Requests (CVE-2026-61736)
The LightRAG application, specifically the 'lightrag-hku' package, contains a critical vulnerability (CVE-2026-61736) due to its default Cross-Origin Resource Sharing (CORS) configuration, enabling any malicious website to perform authenticated API calls on behalf of a logged-in LightRAG user, leading to unauthorized data exfiltration or destructive actions.
A critical Cross-Origin Resource Sharing (CORS) misconfiguration, identified as CVE-2026-61736, affects the LightRAG application's lightrag-hku package in versions prior to 1.5.4. The vulnerability stems from the default server configuration in lightrag/api/config.py and lightrag/api/lightrag_server.py, which sets CORS_ORIGINS to * (wildcard) while also enabling allow_credentials=True for Starlette's CORSMiddleware. This combination causes the server to echo the requesting origin in preflight responses, effectively whitelisting any origin for credentialed cross-origin requests. Attackers can leverage this flaw by hosting a malicious website that performs authenticated API calls to LightRAG on behalf of a victim user who is logged into LightRAG, allowing for data exfiltration of documents and knowledge graphs or the execution of destructive actions.
Attack Chain
- An attacker hosts a malicious website (e.g.,
attacker.com) designed to interact with LightRAG. - A victim, who is logged into their LightRAG instance, navigates to the attacker's malicious website.
- Embedded JavaScript on
attacker.comsends a cross-origin HTTP request to the LightRAG server (e.g., to the/loginendpoint) with thecredentials: "include"option. - The LightRAG server, due to its misconfigured
CORSMiddleware(allow_origins=["*"]andallow_credentials=True), processes the preflight request and responds withAccess-Control-Allow-Originset toattacker.comandAccess-Control-Allow-Credentials: true. - The victim's browser, observing the permissive CORS headers, allows the malicious script to continue making authenticated requests using the victim's session cookies or authentication tokens.
- The malicious script then makes subsequent authenticated GET requests to sensitive LightRAG API endpoints (e.g.,
/documents) to retrieve user data. - The LightRAG server responds to these requests as if they were legitimate, returning sensitive information like documents or knowledge graph data.
- The attacker's website subsequently exfiltrates the retrieved sensitive data or issues commands to perform destructive actions, such as deleting the document store.
Impact
The vulnerability represents a permissive cross-domain policy (CWE-942) that allows any website visited by an authenticated LightRAG user to silently make authenticated API requests. The direct consequence is unauthorized access and manipulation of user data. Attackers can exfiltrate sensitive information, including all documents and knowledge graph data, or perform destructive actions such as deleting the entire document store, without the victim's explicit consent or knowledge. There are no reported numbers of victims or specific sectors targeted, but any organization using vulnerable LightRAG versions is at risk.
Recommendation
- Patch CVE-2026-61736 by upgrading the
lightrag-hkupackage to version 1.5.4 or later immediately. - Review LightRAG web server access logs for unusual
Originheaders combined with requests to sensitive API endpoints, especially those not matching your known allowed origins. - Ensure that the
CORS_ORIGINSconfiguration for LightRAG is set to specific, trusted domains rather than a wildcard (*) whenallow_credentialsisTrue. - Implement security best practices for web applications, including secure credential handling and strict CORS policies.