CVE-2025-6853: Langchain-Chatchat: path traversal in KB upload

GHSA-qmgv-j263-qr33 CRITICAL PoC AVAILABLE CISA: TRACK*
Published June 29, 2025
CISO Take

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?

Package Ecosystem Vulnerable Range Patched
LangChain pip No patch
139.8K OpenSSF 5.9 2.7K dependents Pushed 2d ago 24% patched ~156d to patch Full package profile →
LangChain pip <= 0.3.1.3 No patch
139.8K OpenSSF 5.9 2.7K dependents Pushed 2d ago 24% patched ~156d to patch Full package profile →

How severe is it?

CVSS 3.1
9.8 / 10
EPSS
0.5%
chance of exploitation in 30 days
Higher than 38% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
CISA SSVC: Public PoC
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the attack surface?

AV AC PR UI S C I A
AV Network
AC Low
PR None
UI None
S Unchanged
C High
I High
A High

What should I do?

6 steps
  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 does CISA's SSVC say?

Decision Track*
Exploitation poc
Automatable No
Technical Impact partial

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:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.7.3 - Information security in AI system development
NIST AI RMF
MANAGE 2.2 - Mechanisms are in place and applied to sustain the value of deployed AI systems
OWASP LLM Top 10
LLM02 - Sensitive Information Disclosure LLM08 - Vector and Embedding Weaknesses

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

RAG pipelinesKnowledge base systemsLLM application frameworksDocument processing pipelines

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

EU AI Act: Article 15
ISO 42001: A.7.3
NIST AI RMF: MANAGE 2.2
OWASP LLM Top 10: LLM02, LLM08

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'): 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

Timeline

Published
June 29, 2025
Last Modified
September 16, 2025
First Seen
June 29, 2025

Related Vulnerabilities