Chainlit is vulnerable to a file upload block bypass in the "spontaneousfileupload" functionality. Disabling the feature with the "enabled = false" option only affects the frontend, while the backend upload endpoints remain active and can be abused directly. An attacker with a valid session ID can send requests to these backend endpoints to upload arbitrary file types and then generate a retrieval URL that is accessible to anyone who obtains the link. This allows the attacker to serve malicious content, such as a fake login pages, from the application's trusted domain, which can be used for phishing attacks against users.
The vulnerability has only been confirmed in versions 2.10.0 and 2.12.0 but may also affect other versions.
Chainlit before 2.10.1 contains a session hijacking vulnerability that allows unauthenticated attackers to restore and inherit authenticated user sessions by presenting a valid sessionId during WebSocket session restoration without ownership verification. Attackers can exploit the restoreexistingsession path to assume a victim's permissions and roles, enabling unauthorized invocation of tools and access to data restricted to the authenticated victim.