CVE-2026-51882: Langchain-Chatchat: path traversal in /v1/files file write
CRITICALCISA: ATTENDLangchain-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.
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?
How severe is it?
What is the attack surface?
What should I do?
1 step1) 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?
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-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
MITRE ATLAS Techniques
AML.T0049Exploit Public-Facing ApplicationAML.T0070RAG PoisoningAML.T0112Machine CompromiseCompliance Controls Affected
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:NReferences
Timeline
Related Vulnerabilities
CVE-2025-512010.0smolagents: sandbox escape enables unauthenticated RCE
Same attack type: Code ExecutionCVE-2025-5952810.0Flowise: Unauthenticated RCE via MCP config injection
Same attack type: Code ExecutionCVE-2025-282810.0LangChain RequestsToolkit: SSRF exposes cloud metadata
Same attack type: Auth BypassCVE-2025-5376710.0Azure OpenAI: SSRF EoP, no auth required (CVSS 10)
Same attack type: Auth BypassCVE-2024-291210.0BentoML: RCE via insecure deserialization (CVSS 10)
Same attack type: Code Execution