The vulnerability is an authorization bypass where a logged-in user can access another user's conversation threads. The root cause is a missing authorization check in the websocket connection logic. The patch is in commit 8f1153db439eca58ae5c50c8276ba6fdd311448e, which modifies backend/chainlit/socket.py.
The function connect in this file is the entry point for websocket connections. The patch introduces a new authorization check within this function. When a client provides a thread_id to resume a session, the updated code now fetches the thread's author via data_layer.get_thread_author(thread_id) and compares it against the authenticated user's identifier. If they do not match, the connection is terminated.
Prior to this fix, no such check existed, allowing any authenticated user to access any thread by its ID. Therefore, the connect function is the vulnerable function, as it was the point where the authorization was improperly handled. An exploit would involve a call to this function with a thread_id belonging to a different user.