CVE-2026-7847: Langchain-Chatchat: predictable file IDs leak uploaded files
GHSA-jv4p-mhmp-69vw LOW CISA: TRACK*Langchain-Chatchat's file upload handler generates file IDs using an insufficiently random algorithm (CWE-330), allowing an adjacent-network attacker with low-privilege credentials to predict and enumerate IDs to access files uploaded by other users. Despite a CVSS score of 2.6, the EPSS places this vulnerability in the top 94th percentile for exploitation likelihood, a public PoC writeup exists on GitHub, and critically there is no patch for versions up to 0.3.1.3. With 2,603 downstream dependents, a package risk score of 77/100, and 48 historical CVEs in the same package, this reflects a pattern of structural security debt in a widely-deployed LLM framework. Until a patch is released, isolate the application to trusted internal networks, enforce strict API authentication, and audit access logs for anomalous sequential file ID requests.
What is the risk?
Practical risk meaningfully exceeds the CVSS 2.6 rating. No upstream patch exists. The researcher PoC is publicly documented and referenced in the GitHub issue tracker. In multi-user or enterprise LLM chat deployments where users upload sensitive documents, the blast radius is significant. The adjacent-network and high-complexity constraints are real mitigations for internet-exposed deployments but are routinely satisfied inside corporate networks or shared cloud tenancies. The package's history of 48 CVEs and 77/100 risk score indicates systemic security hygiene concerns that warrant deeper review beyond this single finding.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| LangChain | pip | <= 0.3.1.3 | No patch |
Do you use LangChain? You're affected.
How severe is it?
What is the attack surface?
What should I do?
6 steps-
No upstream patch is available for versions <= 0.3.1.3 — evaluate whether deployment can be isolated or suspended until patched.
-
Restrict API access to the minimum required network scope; enforce network segmentation to prevent adjacent access from untrusted hosts.
-
Apply a local code patch to replace the _get_file_id implementation in openai_routes.py with Python's secrets.token_urlsafe() or os.urandom(32).hex() for cryptographically secure ID generation.
-
Add server-side access control to validate that the requesting user matches the original file uploader before returning file content.
-
Audit server logs for sequential or patterned file ID access attempts as an indicator of active exploitation.
-
Pin the dependency and subscribe to upstream releases for a patch.
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-7847?
Langchain-Chatchat's file upload handler generates file IDs using an insufficiently random algorithm (CWE-330), allowing an adjacent-network attacker with low-privilege credentials to predict and enumerate IDs to access files uploaded by other users. Despite a CVSS score of 2.6, the EPSS places this vulnerability in the top 94th percentile for exploitation likelihood, a public PoC writeup exists on GitHub, and critically there is no patch for versions up to 0.3.1.3. With 2,603 downstream dependents, a package risk score of 77/100, and 48 historical CVEs in the same package, this reflects a pattern of structural security debt in a widely-deployed LLM framework. Until a patch is released, isolate the application to trusted internal networks, enforce strict API authentication, and audit access logs for anomalous sequential file ID requests.
Is CVE-2026-7847 actively exploited?
No confirmed active exploitation of CVE-2026-7847 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-7847?
1. No upstream patch is available for versions <= 0.3.1.3 — evaluate whether deployment can be isolated or suspended until patched. 2. Restrict API access to the minimum required network scope; enforce network segmentation to prevent adjacent access from untrusted hosts. 3. Apply a local code patch to replace the _get_file_id implementation in openai_routes.py with Python's secrets.token_urlsafe() or os.urandom(32).hex() for cryptographically secure ID generation. 4. Add server-side access control to validate that the requesting user matches the original file uploader before returning file content. 5. Audit server logs for sequential or patterned file ID access attempts as an indicator of active exploitation. 6. Pin the dependency and subscribe to upstream releases for a patch.
What systems are affected by CVE-2026-7847?
This vulnerability affects the following AI/ML architecture patterns: LLM chat applications, document upload and processing pipelines, RAG pipelines, agent frameworks.
What is the CVSS score for CVE-2026-7847?
CVE-2026-7847 has a CVSS v3.1 base score of 2.6 (LOW). The EPSS exploitation probability is 0.24%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0006 Active Scanning AML.T0025 Exfiltration via Cyber Means AML.T0037 Data from Local System AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
A vulnerability was found in chatchat-space Langchain-Chatchat up to 0.3.1.3. The affected element is the function _get_file_id of the file libs/chatchat-server/chatchat/server/api_server/openai_routes.py of the component Uploaded File Handler. Performing a manipulation results in insufficiently random values. Access to the local network is required for this attack. The attack's complexity is rated as high. The exploitability is described as difficult. The exploit has been made public and could be used. The project was informed of the problem early through an issue report but has not responded yet.
Exploitation Scenario
An attacker with access to the internal network — via a compromised endpoint, shared cloud environment, or malicious insider — authenticates to the Langchain-Chatchat API with any low-privilege account. They upload a test file and observe the returned file ID. By analyzing the ID structure (predictable due to a weak PRNG), they derive the generation algorithm and enumerate forward and backward in the ID space. HTTP requests using enumerated IDs return files uploaded by other users. Sensitive documents submitted for private RAG sessions — contracts, HR records, financial data — are retrieved without authorization.
Weaknesses (CWE)
CWE-310
Primary
CWE-330 Use of Insufficiently Random Values
Primary
CWE-330 Use of Insufficiently Random Values
Primary
CWE-330 — Use of Insufficiently Random Values: The product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers.
- [Architecture and Design] Use a well-vetted algorithm that is currently considered to be strong by experts in the field, and select well-tested implementations with adequate length seeds. In general, if a pseudo-random number generator is not advertised as being cryptographically secure, then it is probably a statistical PRNG and should not be used in security-sensitive contexts. Pseudo-random number generators can produce predictable numbers if the generator is known and the seed can be guessed. A 256-bit seed is a good starting point for producing a "random enough" number.
- [Implementation] Consider a PRNG that re-seeds itself as needed from high quality pseudo-random output sources, such as hardware devices.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:A/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N References
- github.com/3em0/cve_repo/blob/main/Langchain-Chatchat/Vuln-3-Predictable-File-ID.md
- github.com/chatchat-space/Langchain-Chatchat/
- github.com/chatchat-space/Langchain-Chatchat/issues/5464
- vuldb.com/submit/807796
- vuldb.com/vuln/361126
- vuldb.com/vuln/361126/cti
- github.com/advisories/GHSA-jv4p-mhmp-69vw
- github.com/chatchat-space/Langchain-Chatchat
- nvd.nist.gov/vuln/detail/CVE-2026-7847
Timeline
Related Vulnerabilities
CVE-2025-2828 10.0 LangChain RequestsToolkit: SSRF exposes cloud metadata
Same package: langchain CVE-2023-34540 9.8 LangChain: RCE via JiraAPIWrapper crafted input
Same package: langchain CVE-2023-29374 9.8 LangChain: RCE via prompt injection in LLMMathChain
Same package: langchain CVE-2023-34541 9.8 LangChain: RCE via unsafe load_prompt deserialization
Same package: langchain CVE-2023-36258 9.8 LangChain: unauthenticated RCE via code injection
Same package: langchain