Prefab UI sandbox escape: what FastMCP Generative UI servers should check
A critical flaw let code sent to FastMCP's generate_prefab_ui tool read and write files on the server. Who is exposed, what 0.21.0 changes and what to check.
On 1 November 2026, a critical advisory was published for Prefab UI, the component library behind FastMCP's Generative UI feature. Code that was meant to run in an isolated sandbox could read and write files on the server as the server's own operating system user, and keep running after a restart. If you run a FastMCP server with Generative UI turned on, the question is not whether a model might write bad UI code, but who can send code to that tool at all.
What Generative UI does
FastMCP's Generative UI documentation describes a provider you add with one line, mcp.add_provider(GenerativeUI()), after installing the fastmcp[apps] extra. It registers a generate_prefab_ui tool, a search_prefab_components tool and a renderer that streams the result to the client. The model writes Python that builds an interface from Prefab components, and the server runs that code again in a server-side Pyodide sandbox to validate it. Pyodide is Python compiled to WebAssembly, and here it runs inside a Deno subprocess.
The design makes sense: the code comes from a model, possibly steered by whatever it read, so it is treated as untrusted and run somewhere that should not be able to touch the host. The advisory is about that "should".
What went wrong
According to GHSA-3g72-rrqc-f76c (CVE-2026-120338), from prefab-ui 0.14.0 up to and including 0.20.2 the launcher started Deno with unrestricted file read, file write and network permissions, and left the Deno API reachable from the JavaScript global object. Pyodide's js module gives Python access to that global, so Python code inside the "sandbox" could call Deno's file functions directly.
The consequences the advisory lists are direct:
- read any file the server's operating system user can read, such as configuration, keys and tokens;
- write files as that user;
- persist code execution by writing a
.pthfile into the virtual environment'ssite-packages, which Python runs at every start-up.
The remote path is FastMCP's provider. The code argument of generate_prefab_ui goes straight into the sandbox. The advisory puts the exposure plainly: on a FastMCP server with no authentication, any client that can reach the server can call the tool; with authentication, any client allowed to call tools can.
GitHub rates it critical, CVSS 3.1 base score 10.0, with a network attack vector, no privileges and no user interaction required, and a changed scope. The scope change reflects the escape itself: code leaves the sandbox and acts on the host.
Who is actually exposed
Fewer servers than the score suggests, but the ones that are exposed are badly exposed. The advisory names two conditions: Generative UI is opt-in, and the host must have Deno.
On the second point the sources differ. The advisory says the host "must have Deno installed", while the FastMCP documentation says Deno installs automatically on first use. If you rely on "we never installed Deno" as your reason for being safe, check the host rather than your memory of setting it up.
There is also a dependency detail worth checking. On FastMCP's main branch, the apps extra asks for prefab-ui>=0.18.0, so upgrading FastMCP does not by itself move you to a fixed Prefab release. A lockfile can keep 0.20.2 in place for as long as nobody updates it.
The fix, and its timing
The fix is in Prefab UI 0.21.0, released on 26 October 2026, with 0.21.1 following the same evening as a documentation fix. Per the advisory, the runner now revokes read, write and network permission once the runtime and Prefab's own sources have loaded, before it accepts any code. The process starts with --no-prompt, so a permission request can't grant them back, and network access during start-up is limited to cdn.jsdelivr.net.
The change itself is commit 030f074 in pull request 538, merged on 25 October under the title "Refresh dependencies and fix renderer and sandbox regressions". Nothing in that title says "security". The fixed release was out about six days before the advisory. A team that upgraded promptly was protected before the flaw was public; a team that only reads advisories had no reason to upgrade until 1 November.
At the time of writing, the advisory record in the GitHub Advisory Database lists no structured affected-package entry, only the version range in its text. Scanners that match on structured ranges may therefore not flag a vulnerable lockfile. Search for it by package name rather than waiting for an alert.
We saw the same pattern of quiet fixes followed by advisories in the FastMCP October advisories and in fixes that shipped long before their advisories.
What it means for engineering and security leaders
- A sandbox is a claim, not a property. Generative UI was documented as isolation for untrusted code. Treat any in-process or subprocess sandbox in an MCP server as something to test, with the question "what can this code reach if it tries?", not as a reason to expose a code-running tool more widely. Our look at sandboxing coding agents covers the same question for agents.
- Tools that accept code are a different class of tool. A tool whose argument is a program deserves the access controls you would give a remote shell. If your MCP server has no authentication because "it only renders UI", this advisory is the reason to add it.
- Your inventory needs package versions, not just server names. The vulnerable component sits two layers down: an MCP server, built on FastMCP, using an optional extra, pulling in Prefab. Teams that can answer "which servers run prefab-ui below 0.21.0?" in minutes are in a much better place than teams that have to ask around.
Practical takeaways
- Search your repositories and images for
prefab-uiand check the resolved version. Anything from 0.14.0 to 0.20.2 is affected; move to 0.21.0 or later and rebuild. - Search FastMCP server code for
GenerativeUI(oradd_providerto find where the feature is turned on. - On those hosts, check whether Deno is present, whatever your setup notes say.
- Make sure every FastMCP server reachable over a network has authentication, and limit which clients may call
generate_prefab_ui. - If an affected server was reachable by untrusted clients, look for unexpected
.pthfiles in its virtual environment'ssite-packages, and rotate credentials readable by its user. - Follow upstream releases, not only advisories: here the fix came first.
If your AI tools reach MCP servers through SpanDock's MCP gateway (Premium and Enterprise plans), you can add your own MCP servers to it and deny tools by name for people, groups or user types, so a tool such as generate_prefab_ui can be blocked for everyone while servers are upgraded. That only covers calls that go through the gateway, not clients that can reach the server directly.