CVE-2026-51882: Langchain-Chatchat: path traversal in /v1/files file write

CRITICALCISA: ATTEND
Published October 1, 2026
CISO Take

Langchain-Chatchat 0.3.0 has a path traversal flaw in its OpenAI-compatible /v1/files upload endpoint. An unauthenticated remote attacker can use a crafted filename to write files anywhere the service account can write, outside the intended openai_files directory. NVD scores it CVSS 9.1 (critical, network-reachable, no privileges or user interaction needed). EPSS is a low 0.00145 raw but is placed in the top 97th percentile, and the CVE is not in CISA KEV. No Nuclei template or confirmed public exploit is recorded. The linked gist and GitHub issue #5468 may contain technical details or a proof of concept, so weaponization could be quick. Arbitrary file write on a host that serves LLM and RAG workloads can lead to code execution, depending on what the attacker overwrites and how the service is deployed. I found no fixed version in the data, so the action is to take the endpoint off untrusted networks, put authentication or a filtering reverse proxy in front of it, and check upstream issue #5468 for a patch.

Sources:NVDEPSSATLASGitHub issue chatchat-space/Langchain-Chatchat#5468

What is the risk?

Risk is HIGH for any internet-facing or broadly reachable Chatchat 0.3.0 deployment, and MODERATE for deployments restricted to trusted internal networks. CVSS 9.1 reflects network attack vector, low complexity, no privileges, no user interaction, with high confidentiality and integrity impact and no availability impact. EPSS is 0.00145 (top 97th percentile), the CVE is not in CISA KEV, and no public exploit or scanner template is recorded. The referenced gist may hold a PoC, which would raise the real exploitation likelihood. The CWE and affected-product fields are empty and package risk data is unavailable (Scorecard N/A, dependents unknown), so exposure estimates carry uncertainty. The project is a self-hosted open-source RAG and chat application, which is often deployed without an authentication layer in front of the API.

How does the attack unfold?

Initial Access
Attacker finds an exposed Langchain-Chatchat 0.3.0 instance and reaches the unauthenticated /v1/files endpoint.
AML.T0049
Exploitation
A crafted filename with path traversal sequences makes the server write the uploaded file outside the openai_files directory.
AML.T0049
Persistence
Attacker overwrites config, application, startup, or knowledge base files so the malicious content is loaded or used later.
Impact
Possible code execution, credential theft, RAG content poisoning, or lateral movement from the compromised AI host.
AML.T0112

How severe is it?

CVSS 3.1
9.1 / 10
EPSS
0.5%
chance of exploitation in 30 days
Higher than 44% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
○CISA SSVC: Public PoC
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
ANone

What should I do?

1 step
  1. 1) Do not expose Langchain-Chatchat 0.3.0 or its /v1/files endpoint to untrusted or public networks; restrict access by firewall, VPN, or an authenticating reverse proxy. 2) Check issue #5468 and the project releases for a fixed version and upgrade once one is available. I could not confirm a patched release from the data provided. 3) As a workaround, block or disable /v1/files at the proxy, or reject requests whose filename contains '..', path separators, or encoded variants (%2e%2e, %2f, backslashes). 4) Run the service as a non-root user in a container with a read-only root filesystem, and mount only the data directories it needs as writable. 5) Detection: review access logs for POST /v1/files requests with traversal sequences or odd filenames. Run file-integrity monitoring on application, config, and startup directories, and look for unexpected files or modified timestamps outside the openai_files directory. 6) If exposure is suspected, audit the knowledge base content, configs, and scheduled or startup scripts for tampering, and rotate any secrets stored on the host.

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-Procedures to respond to and recover from previously unknown risks
OWASP LLM Top 10
LLM03-Supply ChainLLM05-Improper Output Handling

Frequently Asked Questions

What is CVE-2026-51882?

Langchain-Chatchat 0.3.0 has a path traversal flaw in its OpenAI-compatible /v1/files upload endpoint. An unauthenticated remote attacker can use a crafted filename to write files anywhere the service account can write, outside the intended openai_files directory. NVD scores it CVSS 9.1 (critical, network-reachable, no privileges or user interaction needed). EPSS is a low 0.00145 raw but is placed in the top 97th percentile, and the CVE is not in CISA KEV. No Nuclei template or confirmed public exploit is recorded. The linked gist and GitHub issue #5468 may contain technical details or a proof of concept, so weaponization could be quick. Arbitrary file write on a host that serves LLM and RAG workloads can lead to code execution, depending on what the attacker overwrites and how the service is deployed. I found no fixed version in the data, so the action is to take the endpoint off untrusted networks, put authentication or a filtering reverse proxy in front of it, and check upstream issue #5468 for a patch.

Is CVE-2026-51882 actively exploited?

No confirmed active exploitation of CVE-2026-51882 has been reported, but organizations should still patch proactively.

How to fix CVE-2026-51882?

1) Do not expose Langchain-Chatchat 0.3.0 or its /v1/files endpoint to untrusted or public networks; restrict access by firewall, VPN, or an authenticating reverse proxy. 2) Check issue #5468 and the project releases for a fixed version and upgrade once one is available. I could not confirm a patched release from the data provided. 3) As a workaround, block or disable /v1/files at the proxy, or reject requests whose filename contains '..', path separators, or encoded variants (%2e%2e, %2f, backslashes). 4) Run the service as a non-root user in a container with a read-only root filesystem, and mount only the data directories it needs as writable. 5) Detection: review access logs for POST /v1/files requests with traversal sequences or odd filenames. Run file-integrity monitoring on application, config, and startup directories, and look for unexpected files or modified timestamps outside the openai_files directory. 6) If exposure is suspected, audit the knowledge base content, configs, and scheduled or startup scripts for tampering, and rotate any secrets stored on the host.

What systems are affected by CVE-2026-51882?

This vulnerability affects the following AI/ML architecture patterns: Self-hosted RAG pipelines, OpenAI-compatible LLM API gateways, LLM application frameworks, Local knowledge-base chat applications.

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

CVE-2026-51882 has a CVSS v3.1 base score of 9.1 (CRITICAL). The EPSS exploitation probability is 0.51%.

What is the AI security impact?

Affected AI Architectures

Self-hosted RAG pipelinesOpenAI-compatible LLM API gatewaysLLM application frameworksLocal knowledge-base chat applications

MITRE ATLAS Techniques

AML.T0049Exploit Public-Facing Application
AML.T0070RAG Poisoning
AML.T0112Machine Compromise

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, LLM05

What are the technical details?

Original Advisory

The OpenAI-compatible file upload endpoint `/v1/files` in Langchain-Chatchat 0.3.0 is vulnerable to path traversal. An attacker can write files to arbitrary locations outside the `openai_files` directory by crafting malicious filenames.

Exploitation Scenario

An attacker scans for exposed Langchain-Chatchat instances and finds the OpenAI-compatible API on its default port. They send a multipart POST to /v1/files with a filename such as ../../../tmp/payload or a path pointing at an application script, a startup hook, or a knowledge base document. With no authentication required, the server writes the attacker's content outside openai_files. The attacker then overwrites a Python module, config file, or cron or startup script that the service or host later loads, which can give code execution. Alternatively, they plant documents in the knowledge base to poison RAG answers. From there they can read model API keys and credentials from the environment or config, reach internal data sources the assistant is connected to, and pivot deeper into the network.

CVSS Vector

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

Timeline

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

Related Vulnerabilities