Executive brief
Langchain-Chatchat is an application framework used to build AI-powered chat systems. A security flaw in how it handles uploaded files allows attackers to guess the unique identifiers for files stored on the server. If successful, an attacker could read, overwrite, or delete sensitive documents and images uploaded by other users, potentially leading to data theft or service disruption.
Technical details
A vulnerability exists in the `_get_file_id` function within `libs/chatchat-server/chatchat/server/api_server/openai_routes.py`. The application generates file identifiers by base64-encoding a string composed of the file's purpose, upload date, and filename (e.g., `base64("assistants/2026-04-01/photo.png")`). Because this process lacks a random salt or UUID, the identifiers are entirely deterministic. An authenticated attacker can brute-force or guess these identifiers to perform unauthorized file reads, overwrites, or deletions via the `/v1/files/{file_id}` endpoints. While some initial reports suggested local network access was required, the underlying issue is reachable via the network API provided the attacker has valid credentials.
Affected products
- chatchat-space Langchain-Chatchat 0.3.x up to 0.3.1.3
Timeline
- 2026-04-13: disclosed: Issue reported to the project maintainers via GitHub issue #5464
- 2026-05-05: advisory: Vulnerability details published via NVD and VulDB
References
- https://github.com/3em0/cve_repo/blob/main/Langchain-Chatchat/Vuln-3-Predictable-File-ID.md
- https://github.com/chatchat-space/Langchain-Chatchat/
- https://github.com/chatchat-space/Langchain-Chatchat/issues/5464
- https://vuldb.com/submit/807796
- https://vuldb.com/vuln/361126
- https://vuldb.com/vuln/361126/cti