Skip to main content

Langchain-Chatchat CVE-2026-7846

| EUVDEUVD-2026-27392 LOW
Time-of-check Time-of-use (TOCTOU) Race Condition (CWE-367)
2026-05-05 VulDB GHSA-x229-w2j4-h748
1.2
CVSS 4.0 · Vendor: VulDB
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate to Chatchat instance
  2. Delivery
    Craft malicious file upload request
  3. Exploit
    Intercept filename during validation-to-write window
  4. Execution
    Modify filename parameter via race condition
  5. Persist
    Overwrite target file or redirect write path
  6. Impact
    Integrity compromise

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture TOCTOU prevention
Exploitation Conditions

Exploitation requires (1) authenticated access to the Langchain-Chatchat instance (PR:L), (2) network connectivity to the local network segment hosting the vulnerable server (AV:A - not internet-routable), (3) the OpenAI-Compatible File Upload API endpoint must be enabled and accessible to the attacker's user account, and (4) precise timing to execute the race condition between the file.filename validation check and file write operation (AC:H accounts for this complexity). The vulnerability does NOT require special non-default configuration or feature enablement - the API is part of the standard OpenAI compatibility layer. Exploitation is NOT possible from the internet unless the Langchain-Chatchat instance is exposed on a public network interface with authentication bypasses or weak credentials.

Impact

Despite the very low CVSS score of 1.2, this vulnerability carries moderate practical risk in specific deployments. The CVSS vector (AV:A/AC:H/PR:L/UI:N/VC:N/VI:L/VA:N) indicates attack surface is limited to local network attackers with prior authentication (PR:L), high complexity (AC:H), and minimal impact (integrity only, VC/VA/SA all None). However, EPSS data is absent, making exploitation probability assessment incomplete. The availability of public exploit code (E:P) and documented attack scenario elevate practical risk beyond the CVSS numeric score, suggesting real-world attacks are feasible despite high complexity. The integrity impact (VI:L) appears limited, but context-dependent: in file storage contexts, even minor integrity violations can escalate (e.g., silent file overwrite as noted in references). The lack of vendor response indicates no patch is forthcoming, increasing residual risk for deployed instances. Risk is NOT critical enterprise-wide but IS material for organizations running exposed Langchain-Chatchat instances on untrusted local networks or with hostile internal users.

Exploit ScenarioDerived

An authenticated attacker with access to the local network monitors the OpenAI-Compatible File Upload API endpoint. During the brief window between filename validation and actual file storage, the attacker races to modify the filename parameter (via a second request or network manipulation), causing the server to write the uploaded file to an unintended location or with a name that bypasses restrictions. The documented exploit demonstrates silent file overwrite capability, allowing an attacker to replace legitimate application or user files without detection.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
No patch listed yet 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 05, 2026

Time-of-check time-of-use (TOCTOU) vulnerability in Langchain-Chatchat up to 0.3.1.3 allows authenticated local network attackers to manipulate file.filename arguments in the OpenAI-Compatible File Upload API, leading to integrity compromise through race condition exploitation. Publicly available exploit code exists, and the vendor has not responded to early disclosure notification despite proof-of-concept documentation.

RemediationAI

No vendor-released patch has been identified at time of analysis. The project maintainers have not responded to early disclosure despite issue notification. Immediate remediation options are limited: (1) Upgrade to a future patched version if released by chatchat-space (monitor GitHub releases and security advisories); (2) Implement network-level access controls restricting the OpenAI-Compatible File Upload API endpoint to trusted internal networks only, using firewall rules or API gateway authentication; (3) Disable the OpenAI-Compatible File Upload API feature entirely if not required for operations, reducing attack surface; (4) Implement file operation logging and integrity monitoring (checksums, audit trails) on uploaded files to detect race condition exploitation. Organizations should also consider submitting additional reports to the chatchat-space project or seeking community-maintained forks with security patches. None of these workarounds fully eliminate the TOCTOU race condition itself; they only reduce exposure or detectability.

Affected VersionsENISA

Langchain-Chatchat 0.3.1.1
Langchain-Chatchat 0.3.1.3
Langchain-Chatchat 0.3.1.2
Langchain-Chatchat 0.3.1.0

Affected Packages

pypi langchain-chatchat no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability exists in the OpenAI-Compatible File Upload API endpoint (libs/chatchat-server/chatchat/server/api_server/openai_routes.py) and stems from a classic TOCTOU race condition (CWE-367). The file upload handler checks the validity of file.filename at one point in time but uses that filename later without re-validating it, creating a window where an attacker on the local network can modify the filename between the check and use phases. This allows an authenticated user to bypass filename restrictions or manipulate file storage paths. The vulnerability requires local network access (AV:A) and high attack complexity (AC:H), limiting exposure to attackers within network proximity.

Know when Langchain Chatchat gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulDB) PRIMARY 1.2 LOW
CVSS:4.0/AV:A/AC:H/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P

Primary rating from Vendor (VulDB) · only source for this CVE.

CVSS VectorVendor: VulDB

Attack Vector
Adjacent
Attack Complexity
High
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
May 05, 2026 - 16:22 NVD
2.6 (LOW) 1.2 (LOW)

DescriptionCVE.org

A vulnerability has been found in chatchat-space Langchain-Chatchat up to 0.3.1.3. Impacted is the function files of the file libs/chatchat-server/chatchat/server/api_server/openai_routes.py of the component OpenAI-Compatible File Upload API. Such manipulation of the argument file.filename leads to time-of-check time-of-use. Access to the local network is required for this attack to succeed. The attack requires a high level of complexity. The exploitability is considered difficult. The exploit has been disclosed to the public and may be used. The project was informed of the problem early through an issue report but has not responded yet.

Threat Intelligence Overview

EPSS Score
0.0%
Top 97% exploitable
Exploit
POC
Public exploit code exists
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC Yes
EPSS 0.0%
Patch available No
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
Poc
System Exposure· derived
Controlled
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +6
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Malicious file upload attacks exploit insufficient validation when web applications accept user-provided files.

CVE-2026-75128 CRITICAL POC
9.3 Oct 20

Unauthenticated remote command execution in Langchain-Chatchat through version 0.3.1.3 allows any network-reachable atta

CVE-2026-51884 CRITICAL
9.8 Oct 01

Unauthenticated path traversal in Langchain-Chatchat 0.3.1 lets a remote attacker write files to arbitrary filesystem lo

CVE-2026-51882 CRITICAL
9.1 Oct 01

Unauthenticated path traversal in the OpenAI-compatible /v1/files upload endpoint of Langchain-Chatchat 0.3.0 allows rem

CVE-2026-51883 CRITICAL
9.1 Oct 01

Path traversal in Langchain-Chatchat 0.3.0 and 0.3.1 allows unauthenticated remote attackers to write knowledge base con

CVE-2025-6853 LOW POC
2.1 Jun 29

Path traversal in Langchain-Chatchat's backend file upload endpoint allows remote attackers to manipulate file paths via

CVE-2025-6854 LOW POC
2.1 Jun 29

Path traversal in Langchain-Chatchat version 0.3.1 and earlier allows authenticated low-privilege users to read arbitrar

CVE-2026-7844 LOW POC
2.1 May 05

Missing authentication in Langchain-Chatchat up to version 0.3.1.3 allows unauthenticated local network attackers to acc

CVE-2025-6855 LOW POC
2.0 Jun 29

Path traversal vulnerability in Langchain-Chatchat up to 0.3.1 allows authenticated attackers with low privileges to rea

CVE-2026-7847 LOW POC
1.2 May 05

Insufficiently random file ID generation in Langchain-Chatchat up to version 0.3.1.3 allows authenticated local network

CVE-2026-7845 LOW POC
1.2 May 05

Weak hash function in the Vision Chat Paste Image Handler of Langchain-Chatchat up to 0.3.1.3 allows local network attac

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy