Critical · 10.0 Critical vulnerabilities CVE-2026-120338
Prefab UI Pyodide Sandbox Escape Allows Remote Code Execution on the Host (CVE-2026-120338)
A critical flaw in Prefab UI's Generative UI sandbox lets caller-supplied Python code escape its Pyodide/Deno isolation and read, write, and persist code on the host as the server's OS user. Fixed in version 0.21.0.
By PatchBriefing · ·
Produced automatically from official sources with the help of AI. How we work →
AI summary
A critical vulnerability has been identified in Prefab UI's Generative UI sandbox, a feature intended to safely execute caller-supplied Python code, including code written by LLMs, inside a Pyodide (Python-compiled-to-WebAssembly) environment running in a Deno subprocess. The flaw allows that supposedly isolated code to escape the sandbox and interact directly with the host operating system. The issue is tracked as CVE-2026-120338 and carries the maximum CVSS score of 10.0.
What happened
Prefab UI's Generative UI sandbox is designed to run untrusted, caller-supplied Python code in isolation using Pyodide inside a Deno subprocess. In affected versions, the launcher starts Deno with unrestricted file-read, file-write, and network permissions (--allow-read, --allow-write, --allow-net), and the runner leaves Deno's API exposed on the JavaScript global object. Because Pyodide's js module proxies that global object, Python code running inside the sandbox can call Deno.readTextFileSync and Deno.writeTextFileSync directly. This allows a caller who can supply code to the sandbox to read and write arbitrary files as the server's operating system user, and to persist code execution by writing a .pth file into the server's Python virtual environment site-packages directory.
Technical cause
The root cause (CWE-94, Code Injection) is a combination of overly broad Deno process permissions and incomplete isolation between the Deno host environment and the Pyodide/Python sandbox running inside it. Even though Generative UI is documented as an isolation mechanism for untrusted code, the unrestricted --allow-read, --allow-write, and --allow-net flags given to the Deno subprocess effectively undermine that isolation, and leaving the Deno API reachable from within the JavaScript global object gives sandboxed Python code a direct path out.
Who is affected
Prefab UI installations from version 0.14.0 through 0.20.2 that have the Generative UI feature enabled are affected; the feature is opt-in and requires Deno to be installed on the host. The most common remote exposure path is through FastMCP's GenerativeUI provider, which registers an MCP tool named generate_prefab_ui and forwards that tool's code argument straight into the vulnerable sandbox. On a FastMCP server with no authentication configured, any client able to reach the server can trigger this. On a server with authentication, any client permitted to call tools can trigger it. The vulnerability was confirmed on version 0.20.2.
Why it matters
This is a complete sandbox bypass leading to remote code execution. An attacker who can submit code to the Generative UI sandbox can read and write files as the server's operating system user and establish persistent code execution on the host, well beyond the intended Python-in-browser-style isolation. Combined with the lack of required authentication on unconfigured FastMCP deployments, this allows any reachable client to compromise the host.
Affected versions
Prefab UI versions from 0.14.0 up to and including 0.20.2 are affected. The vulnerability was specifically confirmed on version 0.20.2. Version 0.21.0 contains the fix.
Fixes and mitigation
Version 0.21.0 fixes the issue. After the Pyodide runtime and Prefab sources are loaded, the runner now revokes Deno's read, write, and network permissions before accepting any caller-supplied code. The Deno process is also started with --no-prompt, so a runtime permission request cannot silently re-grant those permissions. Bootstrap network access is limited specifically to cdn.jsdelivr.net. The fix corresponds to a specific commit referenced in the project's pull request tracking this change.
Recommended action
Upgrade Prefab UI to version 0.21.0 or later. Until upgraded, consider disabling the Generative UI feature, since it is opt-in and requires Deno to be present on the host. If Generative UI is used through FastMCP's GenerativeUI provider, ensure the FastMCP server has authentication configured and restrict which clients can reach it, as unauthenticated servers allow any reachable client to trigger the vulnerable code path.
PatchBriefing score
10.0 / 10 · Critical
Official CVSS: 10.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
EPSS 0.0121 (68 percentile)
Why this score
The PatchBriefing score equals the official CVSS score; when this article covers several vulnerabilities, the highest one. Signals such as known exploitation and EPSS are listed separately and do not change the score.
Affected versions
Reported fixes
Version 0.21.0 fixes the issue. After the Pyodide runtime and Prefab sources are loaded, the runner now revokes Deno's read, write, and network permissions before accepting any caller-supplied code. The Deno process is also started with --no-prompt, so a runtime permission request cannot silently re-grant those permissions. Bootstrap network access is limited specifically to cdn.jsdelivr.net. The fix corresponds to a specific commit referenced in the project's pull request tracking this change.
How this was built
1 source records were collected, matched and used to prepare the report above.
-
NVD (NIST) database
Revision history
- Published
- Generated
- Published
- Generated