Executive brief
Langchain-Chatchat is an application framework used to build AI-powered chat systems using large language models. A security flaw in how the system handles pasted images allows for potential data manipulation because the software uses a weak method to identify and distinguish between different images. This could allow an attacker to cause the system to confuse one image with another, potentially leading to incorrect data processing or unauthorized file overwrites.
Technical details
A vulnerability exists in the Vision Chat Paste Image Handler of Langchain-Chatchat (up to version 0.3.1.3) within the `libs/chatchat-server/chatchat/webui_pages/dialogue/dialogue.py` file. The root cause is the use of `PIL.Image.tobytes()` to generate image data for hashing, which strips critical metadata such as PNG color palettes. This allows an attacker to construct two different images that produce the same hash (a hash collision). An attacker with local network access and low privileges can exploit this to cause file overwrites or manipulate the dialogue history. The attack is considered high complexity due to the requirements for constructing specific colliding image pairs and potential race conditions. As of the advisory date, no official patch has been released.
Affected products
- chatchat-space Langchain-Chatchat up to 0.3.1.3
Timeline
- 2026-05-05: disclosed: Vulnerability reported via GitHub issue and VulDB
- 2026-05-05: advisory: CVE-2026-7845 published
References
- https://github.com/3em0/cve_repo/blob/main/Langchain-Chatchat/Vuln-1-tobytes-Hash-Collision.md
- https://github.com/chatchat-space/Langchain-Chatchat/
- https://github.com/chatchat-space/Langchain-Chatchat/issues/5462
- https://vuldb.com/submit/807794
- https://vuldb.com/vuln/361124
- https://vuldb.com/vuln/361124/cti