CVE-2025-6853: Langchain-Chatchat: path traversal in KB upload
GHSA-qmgv-j263-qr33 CRITICAL PoC AVAILABLE CISA: TRACK*Critical unauthenticated path traversal (CVSS 9.8) in Langchain-Chatchat's knowledge base upload endpoint with no patch available and a public exploit. Any deployment of Chatchat ≤0.3.1 should be taken offline or restricted to internal/VPN access immediately. With zero authentication required and a disclosed exploit, assume compromise if this was internet-facing.
Risk Assessment
Extremely high. CVSS 9.8 with AV:N/AC:L/PR:N/UI:N means any unauthenticated remote attacker can trigger this at will. The 'flag' parameter in /knowledge_base/upload_temp_docs is not sanitized, enabling directory traversal against the underlying host filesystem. With C:H/I:H/A:H, attackers can read sensitive files (API keys, model configs, RAG data) and overwrite files potentially escalating to RCE. No official patch exists as of disclosure.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| langchain-chatchat | pip | — | No patch |
| langchain-chatchat | pip | <= 0.3.1.3 | No patch |
Severity & Risk
Attack Surface
Recommended Action
6 steps-
IMMEDIATE
Take Langchain-Chatchat offline if internet-facing; restrict to VPN/internal access only.
-
No official patch — monitor https://github.com/chatchat-space/Langchain-Chatchat for a fix; do not upgrade blindly without verifying the fix addresses CWE-22.
-
Deploy WAF rules blocking path traversal patterns (../, %2e%2e%2f, encoded variants) on /knowledge_base/ endpoints.
-
Run the service as a least-privilege OS user with filesystem access limited to the application directory.
-
DETECTION
Grep web server logs for POST /knowledge_base/upload_temp_docs requests with 'flag' values containing traversal sequences.
-
If compromise is suspected, audit all files in and around the knowledge base directory and rotate any credentials stored on the host.
CISA SSVC Assessment
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2025-6853?
Critical unauthenticated path traversal (CVSS 9.8) in Langchain-Chatchat's knowledge base upload endpoint with no patch available and a public exploit. Any deployment of Chatchat ≤0.3.1 should be taken offline or restricted to internal/VPN access immediately. With zero authentication required and a disclosed exploit, assume compromise if this was internet-facing.
Is CVE-2025-6853 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2025-6853, increasing the risk of exploitation.
How to fix CVE-2025-6853?
1. IMMEDIATE: Take Langchain-Chatchat offline if internet-facing; restrict to VPN/internal access only. 2. No official patch — monitor https://github.com/chatchat-space/Langchain-Chatchat for a fix; do not upgrade blindly without verifying the fix addresses CWE-22. 3. Deploy WAF rules blocking path traversal patterns (../, %2e%2e%2f, encoded variants) on /knowledge_base/ endpoints. 4. Run the service as a least-privilege OS user with filesystem access limited to the application directory. 5. DETECTION: Grep web server logs for POST /knowledge_base/upload_temp_docs requests with 'flag' values containing traversal sequences. 6. If compromise is suspected, audit all files in and around the knowledge base directory and rotate any credentials stored on the host.
What systems are affected by CVE-2025-6853?
This vulnerability affects the following AI/ML architecture patterns: RAG pipelines, Knowledge base systems, LLM application frameworks, Document processing pipelines.
What is the CVSS score for CVE-2025-6853?
CVE-2025-6853 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 0.63%.
Technical Details
NVD Description
A vulnerability classified as critical has been found in chatchat-space Langchain-Chatchat up to 0.3.1. This affects the function upload_temp_docs of the file /knowledge_base/upload_temp_docs of the component Backend. The manipulation of the argument flag leads to path traversal. It is possible to initiate the attack remotely. The exploit has been disclosed to the public and may be used.
Exploitation Scenario
An unauthenticated attacker sends a crafted POST request to /knowledge_base/upload_temp_docs with the 'flag' parameter set to a path traversal sequence (e.g., ../../app/). The backend resolves the path without sanitization. In a typical enterprise RAG deployment, the attacker first reads the .env file to extract the OpenAI/Anthropic API key and database credentials, then overwrites a Python module in the Chatchat installation with a reverse shell payload — triggered on the next user query. Alternatively, they write a poisoned document directly into the knowledge base directory, causing the LLM to return malicious content to all subsequent users querying that knowledge base.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H References
- github.com/chatchat-space/Langchain-Chatchat/issues/5352 Exploit Issue
- vuldb.com Permissions Required VDB
- vuldb.com 3rd Party VDB
- vuldb.com 3rd Party VDB
- github.com/advisories/GHSA-qmgv-j263-qr33
- nvd.nist.gov/vuln/detail/CVE-2025-6853
- github.com/fkie-cad/nvd-json-data-feeds Exploit
Timeline
Related Vulnerabilities
CVE-2025-2828 10.0 LangChain RequestsToolkit: SSRF exposes cloud metadata
Same package: langchain CVE-2023-34541 9.8 LangChain: RCE via unsafe load_prompt deserialization
Same package: langchain CVE-2023-29374 9.8 LangChain: RCE via prompt injection in LLMMathChain
Same package: langchain CVE-2023-34540 9.8 LangChain: RCE via JiraAPIWrapper crafted input
Same package: langchain CVE-2023-36258 9.8 LangChain: unauthenticated RCE via code injection
Same package: langchain
AI Threat Alert