/

CVE-2026-59216

Severity:

HIGH RISK

(7.7)

Session Confusion RCE (CWE-94) in Open WebUI Sockets

CVE-2026-59216

Analyzed

Vulnerability type

Category:

Remote Code Execution via Session Confusion

CWE:

CWE-94, CWE-200, CWE-639, CWE-862

Impact:

Remote Code Execution in Another User Session

Severity:

HIGH RISK

(7.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Open WebUI contained a session mix-up issue where execute:python and execute:tool Socket.IO events were dispatched based solely on a connected session_id, without confirming the requesting user's ownership of that session.

An authenticated user who could learn another user's socket ID via collaborative document features could trigger code interpreter Python or tool execution in the victim's session, effectively hijacking their code execution context.

Affected context

This vulnerability appears when Open WebUI is deployed with:

  • The Socket.IO-based code interpreter or tool execution features enabled
  • Multiple authenticated users sharing the same instance
  • Collaborative or shared features (such as ydoc:document:join) that expose or indirectly reveal other users' session identifiers

The risk is most pronounced in multi-tenant environments where untrusted users can observe or infer other active socket IDs.

Exploit preconditions

  • Attack surface: WebSocket / Socket.IO interface of Open WebUI.
  • Required access: Authenticated access to the instance and the ability to join or observe collaborative documents that expose other users' session IDs.
  • Trigger point: Issuing get_event_call events that carry execute:python or execute:tool actions targeting a victim's session_id.
  • Why exploitation is possible: The server checks only that a session_id is connected, but does not verify that the caller owns or controls that session, enabling horizontal privilege misuse.

Why this happens

The core problem is an authorization flaw where session-scoped actions are bound to a client-supplied session_id without strong ownership validation.

This maps primarily to CWE-94: Improper Control of Generation of Code, because the attacker can indirectly cause arbitrary Python code or tool invocations to run in another user's interpreter context.

It is also related to CWE-639 (Insecure Direct Object Reference) and CWE-862 (Missing Authorization) since the design trusts unvalidated identifiers for security decisions across WebSocket events.

Potential impact

  • Hijacking another user's code interpreter session to run arbitrary Python code in their context
  • Execution of tools or actions as another user, potentially accessing their data or integrations
  • Exposure of sensitive information processed or visible within the victim's session
  • Lateral movement within a multi-user instance through abuse of shared or collaborative features

General mitigation guidance

Mitigation generally focuses on strengthening session binding and authorization checks for all Socket.IO events.

Common defensive patterns include:

  • Ensuring that server-side handlers derive the effective session or user identity from the authenticated connection, not from client-supplied IDs
  • Applying strict authorization checks for every event that triggers code execution or tool invocation
  • Designing collaborative features so that internal identifiers (such as socket IDs) are not exposed or guessable by other users
  • Limiting the capabilities of code interpreter and tools with least-privilege principles, so that compromise of a single session has constrained blast radius

How teams detect issues like this

Detection often relies on reviewing both code and runtime behavior:

  • Static or manual code review focusing on WebSocket / Socket.IO handlers that accept client-supplied identifiers for session, user, or room selection
  • Authorization-focused tests that attempt to invoke privileged actions against other users' sessions using modified session_id parameters
  • Centralized logging of execute:python and execute:tool events, including both authenticated user identity and target session identifiers, to spot cross-user anomalies
  • Use of automated application security testing or SAST tools configured to flag missing authorization checks in event-driven handlers

Sources

SourceLink
github.comgithub.com/open-webui/open-webui/commit/386ac958144dbbbf0aa6e268070d72b681a318aa
github.comgithub.com/open-webui/open-webui/pull/25763
github.comgithub.com/open-webui/open-webui/releases/tag/v0.10.0
github.comgithub.com/open-webui/open-webui/security/advisories/GHSA-74h3-cxq7-vc5q

Frequently asked

questions

Exploitability is limited to authenticated users who can discover other users' session IDs, typically via collaborative document or shared-session features. It is not exploitable by unauthenticated attackers.

No special administrative privileges are required; any authenticated user with access to features that leak or reveal socket IDs could attempt to target another user's session.

The safest pattern is to bind all execution events to the authenticated connection's server-side session and ignore client-supplied session identifiers for authorization decisions. Each event handler should verify that the caller is authorized to act on the target session or resource.

Preventing similar flaws involves consistently enforcing server-side authorization, avoiding trust in client-supplied IDs for security decisions, and applying security reviews to WebSocket and event-driven code paths. Incorporating automated checks for missing authorization and ID-based access control in CI pipelines can help catch such issues early.

Find out what's already
exploitable in your codebase.