CVE-2026-51884: Langchain-Chatchat: path traversal enables arbitrary file write

CRITICALPoC AVAILABLECISA: ATTEND
Published October 1, 2026
CISO Take

Langchain-Chatchat 0.3.1 has a path traversal flaw in its temporary document upload endpoint (/knowledge_base/upload_temp_docs) that lets an unauthenticated remote attacker write files to arbitrary locations on the server by crafting malicious filenames. The CVSS score is 9.8 because exploitation needs no credentials, no user interaction and low complexity, and arbitrary file write on a server usually leads to remote code execution, for example by overwriting scripts, cron entries or SSH keys. Current exploitation signals are low: EPSS is 0.5% (59th percentile), the CVE is not in CISA KEV, and no public exploit or Nuclei template is confirmed, but a public gist and a GitHub issue describe the flaw, so a working exploit is trivial to build. Downstream dependents and affected product metadata are unknown, so assume any internet-exposed or internal Chatchat deployment is affected. Inventory Chatchat instances now, remove them from public exposure or put authentication in front of the endpoint, and watch the upstream issue #5466 for a fixed release since no patched version is confirmed.

Sources:NVDEPSSATLASGitHub Issues (chatchat-space/Langchain-Chatchat #5466)

What is the risk?

High, bordering on critical for exposed instances. The attack vector is network, complexity is low, and no privileges or user interaction are needed (CVSS 9.8: C:H/I:H/A:H). Chatchat is a self-hosted local knowledge-base and RAG chat application, and many deployments run with default settings and no authentication in front of the API. Real-world exploitation likelihood is currently modest (EPSS 0.5%, no KEV, no confirmed public exploit or scanner template), but the public gist and issue lower the effort needed to weaponize it. Because the CWE and affected product versions are not formally listed, scoping relies on the description, which names version 0.3.1 specifically; other versions have not been confirmed safe.

How does the attack unfold?

Initial Access
Attacker sends an unauthenticated multipart request to /knowledge_base/upload_temp_docs on an exposed Chatchat server.
AML.T0049
Exploitation
A crafted filename with traversal sequences makes the server write attacker-controlled content outside the temporary directory.
Execution and Persistence
The attacker overwrites a script, module, cron entry or SSH key file to gain code execution and a persistent foothold.
Impact
The attacker steals API keys and knowledge-base data, tampers with RAG content, or disrupts the service.
AML.T0037

How severe is it?

CVSS 3.1
9.8 / 10
EPSS
0.6%
chance of exploitation in 30 days
Higher than 50% 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?

AVACPRUISCIA
AVNetwork
ACLow
PRNone
UINone
SUnchanged
CHigh
IHigh
AHigh

What should I do?

1 step
  1. 1) Check upstream (chatchat-space/Langchain-Chatchat issue #5466) for a fixed release and upgrade beyond 0.3.1 as soon as one is available. 2) Until patched, block or disable the /knowledge_base/upload_temp_docs endpoint at the reverse proxy or WAF, and do not expose the Chatchat API to the internet. 3) Place the service behind authentication (SSO, VPN or mTLS) and restrict network access to trusted users. 4) Run Chatchat as an unprivileged user in a container with a read-only root filesystem and only the data directories writable. 5) Add WAF rules that reject filenames containing ../, ..\, encoded variants (%2e%2e%2f) or absolute paths in multipart uploads. 6) Detection: review web and proxy logs for requests to upload_temp_docs with traversal sequences in the filename field, and monitor for unexpected file creation or modification outside the temp directory (file integrity monitoring, auditd). 7) Rotate LLM provider keys and other secrets stored on hosts where exploitation is suspected.

What does CISA's SSVC say?

DecisionAttend
Exploitationpoc
AutomatableYes
Technical Impacttotal

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.6.2.6-AI system operation and monitoring
NIST AI RMF
MANAGE 2.3-Responses to previously unknown or newly identified risks
OWASP LLM Top 10
LLM03-Supply Chain

Frequently Asked Questions

What is CVE-2026-51884?

Langchain-Chatchat 0.3.1 has a path traversal flaw in its temporary document upload endpoint (/knowledge_base/upload_temp_docs) that lets an unauthenticated remote attacker write files to arbitrary locations on the server by crafting malicious filenames. The CVSS score is 9.8 because exploitation needs no credentials, no user interaction and low complexity, and arbitrary file write on a server usually leads to remote code execution, for example by overwriting scripts, cron entries or SSH keys. Current exploitation signals are low: EPSS is 0.5% (59th percentile), the CVE is not in CISA KEV, and no public exploit or Nuclei template is confirmed, but a public gist and a GitHub issue describe the flaw, so a working exploit is trivial to build. Downstream dependents and affected product metadata are unknown, so assume any internet-exposed or internal Chatchat deployment is affected. Inventory Chatchat instances now, remove them from public exposure or put authentication in front of the endpoint, and watch the upstream issue #5466 for a fixed release since no patched version is confirmed.

Is CVE-2026-51884 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2026-51884, increasing the risk of exploitation.

How to fix CVE-2026-51884?

1) Check upstream (chatchat-space/Langchain-Chatchat issue #5466) for a fixed release and upgrade beyond 0.3.1 as soon as one is available. 2) Until patched, block or disable the /knowledge_base/upload_temp_docs endpoint at the reverse proxy or WAF, and do not expose the Chatchat API to the internet. 3) Place the service behind authentication (SSO, VPN or mTLS) and restrict network access to trusted users. 4) Run Chatchat as an unprivileged user in a container with a read-only root filesystem and only the data directories writable. 5) Add WAF rules that reject filenames containing ../, ..\, encoded variants (%2e%2e%2f) or absolute paths in multipart uploads. 6) Detection: review web and proxy logs for requests to upload_temp_docs with traversal sequences in the filename field, and monitor for unexpected file creation or modification outside the temp directory (file integrity monitoring, auditd). 7) Rotate LLM provider keys and other secrets stored on hosts where exploitation is suspected.

What systems are affected by CVE-2026-51884?

This vulnerability affects the following AI/ML architecture patterns: RAG pipelines, LLM application frameworks, Self-hosted knowledge base chat applications, Document ingestion pipelines.

What is the CVSS score for CVE-2026-51884?

CVE-2026-51884 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 0.62%.

What is the AI security impact?

Affected AI Architectures

RAG pipelinesLLM application frameworksSelf-hosted knowledge base chat applicationsDocument ingestion pipelines

MITRE ATLAS Techniques

AML.T0036Data from Information Repositories
AML.T0037Data from Local System
AML.T0049Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: A.6.2.6
NIST AI RMF: MANAGE 2.3
OWASP LLM Top 10: LLM03

What are the technical details?

Original Advisory

The /knowledge_base/upload_temp_docs temporary document upload endpoint in Langchain Chatchat 0.3.1 is vulnerable to path traversal. By crafting malicious filenames, an attacker can write files to arbitrary locations on the server, bypassing the intended restrictions on the temporary directory.

Exploitation Scenario

An attacker finds an internet-exposed Chatchat instance through Shodan or a port scan. They send a multipart POST to /knowledge_base/upload_temp_docs with a filename such as ../../../../home/app/.ssh/authorized_keys or a path pointing to a Python module that the server imports or a cron directory. The server writes the attacker-controlled content outside the temp directory. The attacker then logs in over SSH or waits for the overwritten script or module to be executed, gaining code execution as the Chatchat service account. From there they read .env files and config containing LLM API keys, exfiltrate the private knowledge base, and use the host as a pivot into the internal network.

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Timeline

Published
October 1, 2026
Last Modified
October 5, 2026
First Seen
October 1, 2026

Related Vulnerabilities