CVE-2026-120338

Prefab UI Pyodide sandbox escape to host RCE

Published Nov 1, 2026 CVSS 3.1 · 9.9 Critical EPSS < 1% KEV · Not listed
Description
Prefab UI's Generative UI sandbox runs caller-supplied Python inside Pyodide, Python compiled to WebAssembly, in a Deno subprocess. The feature is documented as isolation for untrusted code, including LLM-written UI. From prefab-ui 0.14.0 through 0.20.2 the launcher starts Deno with unrestricted --allow-read, --allow-write, and --allow-net, and the runner leaves the Deno API on the JavaScript global object. Pyodide's js module proxies that global, so the Python can call Deno.readTextFileSync and Deno.writeTextFileSync. A caller who can supply the code can read and write files as the server OS user, and can persist code execution by writing a .pth file into the server virtualenv's site-packages. The usual remote path is FastMCP's GenerativeUI provider, which registers the MCP tool generate_prefab_ui and forwards that tool's code argument into this sandbox. On a FastMCP server with no authentication configured, any client who can reach the server can call the tool. With authentication, any client allowed to call tools can. Generative UI is opt-in, and the host must have Deno installed. Confirmed on prefab-ui 0.20.2. Fixed in 0.21.0: after the runtime and Prefab sources load, the runner revokes Deno read, write, and network permission before it accepts code, the process is started with --no-prompt so a permission request cannot grant them again, and bootstrap network access is limited to cdn.jsdelivr.net. The fix is commit 030f074 (pull request 538).

Analysis

AI-generated

Technical impact

A sandbox that is supposed to isolate caller–supplied Python code actually runs that code inside Pyodide, a WebAssembly Python runtime, while a Deno subprocess is started with unrestricted file read, write, and network permissions. Because the Deno API is exposed on the JavaScript global object, the Python code can invoke Deno.readTextFileSync, Deno.writeTextFileSync, and write .pth files into the host’s virtual environment. The description indicates that this allows the attacker to read and write arbitrary files as the OS user and to persist code execution, effectively giving full remote control of the host system. The vulnerability is a classic example of privilege escalation due to insufficient sandbox isolation (CWE‑269, CWE‑693, CWE‑94). If exploited, the attacker can compromise the confidentiality, integrity, and availability of the server, executing arbitrary payloads and persisting thereafter. The attack requires the ability to submit Python code to the Generative UI sandbox, typically via the FastMCP generate_prefab_ui tool. When a FastMCP server has no authentication or the client is authorized to call tools, any client who can reach the server can trigger the vulnerable path. Verification of the presence of Deno is also required, as the sandbox uses it for I/O.

Affected Systems

The issue affects PrefectHQ Prefab UI versions 0.14.0 through 0.20.2 which launch Deno with the --allow-read, --allow-write, and --allow-net flags. The vulnerability is present only when the host has Deno installed and the Generative UI feature is enabled. Configurations where FastMCP’s GenerativeUI provider is used to forward user code to the sandbox are the most likely exposure.

Risk and Exploitability

The CVSS base score is 9.9, indicating Critical severity. The EPSS score is not available, but the lack of a KEV listing does not diminish the high risk inherent in the feature’s design. The likely vector for exploitation is remote code injection via the Generative UI tool, either from an unauthenticated client on an unprotected FastMCP server or from an authenticated user permitted to call tools. The lack of permission checks in the code path and the unrestricted Deno permissions make successful exploitation straightforward once a call can be made. The patch revokes these permissions before code evaluation and limits network access, removing the primary attack surface.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade PrefectHQ Prefab UI to version 0.21.0 or later, which revokes Deno read, write, and network permissions before executing user code and limits bootstrap network access to cdn.jsdelivr.net.
  • If upgrading is not immediately possible, disable the Generative UI tool (generate_prefab_ui) in FastMCP or restrict its usage so that only authenticated users with explicit permission can call it. This prevents unauthenticated or privileged clients from submitting arbitrary code to the sandbox.
  • Ensure Deno is either removed from the system path in environments where Prefab UI runs or that its execution is constrained to minimal permissions (no --allow-read, --allow-write, or --allow-net) and that the "--no-prompt" flag is used to block permission escalation.

Generated by OpenCVE AI on November 1, 2026 at 16:21 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Prefecthq
Prefecthq prefab-ui
Vendors & Products Prefecthq
Prefecthq prefab-ui
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Prefab UI's Generative UI sandbox runs caller-supplied Python inside Pyodide, Python compiled to WebAssembly, in a Deno subprocess. The feature is documented as isolation for untrusted code, including LLM-written UI. From prefab-ui 0.14.0 through 0.20.2 the launcher starts Deno with unrestricted --allow-read, --allow-write, and --allow-net, and the runner leaves the Deno API on the JavaScript global object. Pyodide's js module proxies that global, so the Python can call Deno.readTextFileSync and Deno.writeTextFileSync. A caller who can supply the code can read and write files as the server OS user, and can persist code execution by writing a .pth file into the server virtualenv's site-packages. The usual remote path is FastMCP's GenerativeUI provider, which registers the MCP tool generate_prefab_ui and forwards that tool's code argument into this sandbox. On a FastMCP server with no authentication configured, any client who can reach the server can call the tool. With authentication, any client allowed to call tools can. Generative UI is opt-in, and the host must have Deno installed. Confirmed on prefab-ui 0.20.2. Fixed in 0.21.0: after the runtime and Prefab sources load, the runner revokes Deno read, write, and network permission before it accepts code, the process is started with --no-prompt so a permission request cannot grant them again, and bootstrap network access is limited to cdn.jsdelivr.net. The fix is commit 030f074 (pull request 538).
Title Prefab UI Pyodide sandbox escape to host RCE
Weaknesses CWE-269
CWE-693
CWE-94
References
Metrics cvssV3_1

{'score': 9.9, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H'}

Weaknesses
  • CWE-269

    Improper Privilege Management

  • CWE-693

    Protection Mechanism Failure

  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
JFROG
Published
Updated
Nov 2, 2026, 7:42 PM
Reserved
Nov 1, 2026, 3:12 PM
Status
Deferred
Published
Nov 1, 2026, 4:18 PM
Modified
Nov 2, 2026, 8:17 PM