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, orXMLHttpRequestwith 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.

