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.

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
135.7K OpenSSF 6.5 2.6K dependents Pushed 7d ago 17% patched ~256d to patch Full package profile →
langchain-chatchat pip <= 0.3.1.3 No patch
135.7K OpenSSF 6.5 2.6K dependents Pushed 7d ago 17% patched ~256d to patch Full package profile →

Severity & Risk

CVSS 3.1
9.8 / 10
EPSS
0.6%
chance of exploitation in 30 days
Higher than 70% 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, CISA SSVC, EPSS, trickest/cve, and Nuclei templates.

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

Recommended Action

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.

CISA SSVC Assessment

Decision Track*
Exploitation poc
Automatable No
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

Classification

Compliance Impact

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.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.

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