CVE-2026-7846: chatchat-space Langchain-Chatchat TOCTOU in File Upload API

CVE-2026-7846 · Severity: low · CVSS 3.1 · Published 2026-05-05

Langchain-Chatchat, an application for building AI-powered chat interfaces, contains a flaw in how it handles file uploads. Because the system uses the original filename to determine where to store a file without checking if that file already exists, one user can accidentally or intentionally overwrite another user's uploaded files. This could lead to data loss or cause the AI to process incorrect information, such as an attacker-controlled image instead of a user's original document.

Technologies: Chatchat-Space Langchain-Chatchat, langchain-chatchat (PyPI). Vendors: Chatchat-Space, PyPI.

Quick answers

Is CVE-2026-7846 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-7846 being exploited in the wild.
How severe is CVE-2026-7846?
Low severity, with a CVSS score of 3.1, published 5 May 2026.
Which products and versions are affected?
Chatchat-Space Langchain-Chatchat up to 0.3.1.3; langchain-chatchat (PyPI) ECOSYSTEM:introduced=0,last_affected=0.3.1.3.
Is there a fix for CVE-2026-7846?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2026-7846 attacked?
It is attacked from the adjacent network, in a software library.
Am I affected by CVE-2026-7846?
Check whether you run Chatchat-Space Langchain-Chatchat or langchain-chatchat (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

A Time-of-Check Time-of-Use (TOCTOU) race condition exists in the OpenAI-Compatible File Upload API of Langchain-Chatchat. The vulnerable function in 'openai_routes.py' generates storage paths based on a deterministic combination of the upload date and the user-supplied filename. Because the server uses 'open(path, "wb")' without conflict detection or per-user isolation, a second upload with the same filename on the same day will silently overwrite the existing file. An attacker with local network access can exploit this to replace legitimate user uploads with malicious content, which the LLM may subsequently retrieve. As of the advisory date, the project has not yet released a patch.

Affected products

  • chatchat-space Langchain-Chatchat up to 0.3.1.3

Identifiers

  • CVE-2026-7846
  • GHSA-x229-w2j4-h748
  • PYSEC-2026-2559

Timeline

  • 2026-04-13: disclosed: Issue reported to the project maintainers via GitHub
  • 2026-05-05: advisory: Vulnerability published by VulDB and NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.