/

CVE-2026-59214

Severity:

HIGH RISK

(7.3)

Stored XSS (CWE-79) in Open WebUI Pyodide Workflows

CVE-2026-59214

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Authenticated Cross-Site Request Forgery and Code Execution via XSS

Severity:

HIGH RISK

(7.3)

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 prior to version 0.10.0 allows stored chat content to execute client-side Python via Pyodide in a same-origin web worker.

When a victim clicks "Run" on a crafted payload, the code can send authenticated same-origin requests to admin-only endpoints and indirectly trigger server-side code execution through configured tools.

Affected context

This vulnerability appears in Open WebUI deployments that:

  • Enable client-side Python execution through Pyodide in a same-origin web worker
  • Allow users to persist chat messages or prompts that can later be executed with a "Run" action
  • Expose administrative or tool-execution endpoints on the same origin as the web UI

It becomes risky when non-admin or semi-trusted users can store prompts that other users, including administrators, may later execute.

Exploit preconditions

  • Attack surface: Web UI chat interface and any feature that lets users store or share executable prompts.
  • Required access: Ability to create or modify stored chat payloads; the attacker does not need admin rights but benefits from an admin later loading and executing the payload.
  • Trigger point: A victim user, potentially an administrator, clicks "Run" on a malicious stored prompt that executes Python in Pyodide.
  • Why exploitation is possible: The Pyodide environment runs in a same-origin web worker, allowing code to use pyodide.http.pyfetch, js.fetch, or XMLHttpRequest with the victim's browser credentials to invoke sensitive same-origin endpoints.

Why this happens

The root cause is the combination of:

  • Executable content (Python code) being stored as part of user-controlled chat payloads
  • Execution occurring in a same-origin context that inherits the victim's authenticated session
  • Insufficient separation and sanitization between user-provided code and privileged browser APIs

This aligns with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting), generalized to include script-like content in a web worker. The application effectively treats stored user input as trusted executable logic without enforcing strict origin isolation or capability restrictions, enabling cross-site scripting behavior that escalates to authenticated same-origin requests.

Potential impact

  • Abuse of the victim's authenticated session to call admin-only HTTP endpoints
  • Unauthorized configuration changes or management actions within Open WebUI
  • Indirect execution of server-side code via trusted tools or back-end integrations triggered through these endpoints
  • Data exfiltration of accessible models, prompts, or system configuration
  • Lateral movement if server-side tools have access to additional infrastructure or credentials

General mitigation guidance

Effective mitigation focuses on reducing the trust and reach of user-provided executable content:

  • Isolate client-side execution environments from privileged origins, ideally using separate origins or containers that cannot access admin endpoints.
  • Treat all user-controlled code or prompts as untrusted and avoid binding them directly to browser APIs that carry authentication context.
  • Introduce capability-based restrictions so Pyodide or similar runtimes cannot freely invoke network APIs against the application's own origin.
  • Require explicit, high-friction confirmation steps before executing potentially dangerous operations initiated from user content, especially when it may reach administrative functions.
  • Apply least-privilege principles to server-side tools and integrations so that even if triggered, their ability to modify or exfiltrate data is minimized.

How teams detect issues like this

Organizations can detect similar vulnerabilities by:

  • Reviewing code paths where user-generated content is stored and later executed or evaluated, especially in web workers or embedded runtimes.
  • Using static analysis or linters to flag patterns where user-controlled values reach execution sinks (e.g., eval-like mechanisms, embedded interpreters, or dynamic code loaders).
  • Implementing security-focused code review checklists that call out:
  • Same-origin use of powerful client-side runtimes
  • Use of fetch/XMLHttpRequest from contexts influenced by user input
  • Any feature that combines stored content with a "Run" or "Execute" action
  • Employing automated security testing tools that simulate untrusted prompts and verify whether they can perform authenticated same-origin requests.

Sources

SourceLink
github.comgithub.com/open-webui/open-webui/security/advisories/GHSA-4r2p-27mh-5m22

Frequently asked

questions

Yes. An attacker who can create or share a malicious chat payload can exploit remote users' browsers when they open and run that payload, even if the attacker never has direct access to the victim's account.

No. The attacker typically only needs the ability to store or share prompts. The attack becomes powerful when a user with higher privileges, such as an administrator, executes the crafted payload.

The safest pattern is to decouple user-controlled executable content from the application's authenticated origin and privileges. That includes running interpreters in a more isolated origin or sandbox, restricting access to network and platform APIs, and ensuring user code cannot directly drive calls to admin or configuration endpoints.

Future designs should treat any persisted content that can be executed as untrusted scripting, apply strict separation of code and data, minimize capabilities available to execution sandboxes, and enforce security reviews for features that allow "Run" or "Execute" on user-supplied content—especially when those environments share the same origin as sensitive backend endpoints.

Find out what's already
exploitable in your codebase.