Executive brief
Chainlit is an open-source framework used to build conversational AI applications and user interfaces. A security flaw in how the system handles message elements allows an authenticated user to trick the server into reading files from its local storage. This could lead to the exposure of sensitive information, such as configuration files, cloud API keys, or internal application data, potentially compromising the entire AI infrastructure.
Technical details
An arbitrary file read vulnerability exists in Chainlit's '/project/element' endpoint due to improper path sanitization during the element update flow. When a custom element is persisted, the application deserializes the request payload into an Element class and calls its 'send' function. If an attacker provides a 'path' property in the payload, the 'persist_file' method in 'BaseSession' copies the file from that server-side path into the attacker's session directory. The attacker can then retrieve the file contents via the '/project/file/<chainlitKey>' endpoint. This vulnerability (CWE-22) requires authentication but allows for the disclosure of any file readable by the Chainlit service process. The issue is fixed in version 2.9.4.
Affected products
- Chainlit Chainlit < 2.9.4
Timeline
- 2025-12-25: patched: Version 2.9.4 released with security fix
- 2026-01-19: advisory: Initial disclosure by VulnCheck and Zafran Security
- 2026-01-20: disclosed: NVD publication date