Open WebUI Stale Admin Role Enables Post-Demotion Cross-User Note Access
Open WebUI is vulnerable to privilege escalation; when a user connects via Socket.IO, their role is stored in an in-memory session pool, and administrative changes do not invalidate this session, allowing unauthorized access and modification of other users' notes after role revocation.
Open WebUI, a web interface for large language models, is susceptible to a privilege escalation vulnerability stemming from how it manages user sessions via Socket.IO. Specifically, when a user establishes a connection, their role (e.g., ‘admin’) is cached in an in-memory SESSION_POOL. Crucially, subsequent administrative actions like role revocation or user deletion, performed through HTTP endpoints, do not invalidate existing Socket.IO sessions. As a result, a user who has been demoted or deleted can retain their previous admin privileges within the active Socket.IO session indefinitely, so long as they maintain the connection via heartbeats. This vulnerability impacts current main branch (commit 6fdd19bf1) and likely all versions with the collaborative document (Yjs) Socket.IO handlers.
Attack Chain
- User B authenticates as an administrator and establishes a Socket.IO connection, which stores their
roleasadminin theSESSION_POOL. - Administrator A demotes User B to a regular user via the
POST /api/v1/users/{B_id}/updateendpoint, modifying the user’s role in the database. - The Socket.IO session remains active, and User B’s
SESSION_POOLentry retains the staleadminrole. - User B’s client continues sending
heartbeatevents to maintain the Socket.IO connection, refreshing only thelast_seen_attimestamp in theSESSION_POOL. - User B sends a
ydoc:document:joinevent with thedocument_idof a note belonging to another user (e.g.,note:<victim_note_id>). - The server-side handler at
socket/main.py:538checks the cached role from theSESSION_POOL, incorrectly granting access due to the staleadminrole. - User B now gains read access to the victim’s note, receives the full document state, and gets live updates.
- User B sends a
ydoc:document:updateevent, and the handler atsocket/main.py:611bypasses authorization using the cached role, allowing User B to modify the victim’s note’s content.
Impact
Successful exploitation of this vulnerability allows unauthorized read and write access to any user’s notes. This occurs even after admin privileges have been legitimately revoked. The attacker only needs to maintain an active Socket.IO connection established while they had administrative rights, which is trivial as heartbeats keep the session alive indefinitely. This grants a false sense of security to administrators who revoke privileges, as the revocation only affects HTTP access but not real-time collaborative access.
Recommendation
- Apply available patches or upgrade Open WebUI to a version that addresses CVE-2026-44553.
- Implement a mechanism to invalidate Socket.IO sessions upon user role changes or deletions to prevent the use of stale privileges. Specifically, invalidate or update
SESSION_POOLentries when user roles are modified via the/api/v1/users/{B_id}/updateendpoint. - Deploy the Sigma rule “Detect Open WebUI Note Access Attempt with Stale Admin Session” to identify potential attempts to access notes using stale admin sessions.
- Review and audit the implementation of the Socket.IO session management, particularly the
connectandheartbeathandlers inbackend/open_webui/socket/main.py, to ensure proper role validation.
Detection coverage 2
Detect Open WebUI Note Access Attempt with Stale Admin Session
mediumDetects potential attempts to access or modify notes in Open WebUI by users who may have had their admin privileges revoked, leveraging stale sessions.
Detect Open WebUI Admin Role Update via API
lowDetects modifications to user roles via the Open WebUI API, which may precede exploitation of stale session vulnerabilities.
Detection queries are available on the platform. Get full rules →