diff --git a/backend/open_webui/socket/main.py b/backend/open_webui/socket/main.py index 2884847a0e..89d9ced221 100644 --- a/backend/open_webui/socket/main.py +++ b/backend/open_webui/socket/main.py @@ -1015,9 +1015,10 @@ async def get_event_call(request_info): async def __event_caller__(event_data): session_id = request_info['session_id'] - # Fast-fail if the client has disconnected. - if session_id not in SESSION_POOL: - log.warning(f'Event caller: session {session_id} no longer connected') + # session_id is client-supplied; only the requesting user's own live session may be targeted. + session = SESSION_POOL.get(session_id) + if session is None or session.get('id') != request_info.get('user_id'): + log.warning(f'Event caller: session {session_id} not owned by requesting user or disconnected') return {'error': 'Client session disconnected.'} try: