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.
What is the risk?
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.
What systems are affected?
How severe is it?
What is the attack surface?
What should I do?
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.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
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.48%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0025 Exfiltration via Cyber Means AML.T0037 Data from Local System AML.T0049 Exploit Public-Facing Application AML.T0070 RAG Poisoning Compliance Controls Affected
What are the technical details?
Original Advisory
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)
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Primary
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') CWE-22 — Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'): The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
- [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylis
- [Architecture and Design] For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
Source: MITRE CWE corpus.
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