← All notes

AnalysisAct

The code said it was safe

A sandbox for LLM-written code carried a comment promising no write access, one line away from the flag that granted it. An MCP server logged that authentication was on and never checked a key. This week's two records are the same bug: security that was written down instead of enforced.

Published
Topics
MCP · AI agent security · Sandboxing · Authentication · CVE · CWE
--allow-writethe flag the Prefab UI sandbox launcher passed to Deno, under a runner comment that said the process had no write access

Two records this week, two different projects, one shape. In both, the code described a security property in plain English, and the part of the code that was supposed to deliver it did something else. Nobody lied. The description and the enforcement had simply stopped being the same thing, and only one of them was ever read by a human.

A sandbox is the command that starts it

Prefab's Generative UI exists to run Python that a model wrote. That is the whole threat model: the code is untrusted by definition, because the author is a language model that may be reading somebody else's text. The design answer was WebAssembly. Run the Python in Pyodide, and the Python cannot touch the host.

Except that WebAssembly is a sandbox only for what the host declines to hand it. Pyodide gives Python a module that reaches the JavaScript global object, and the runner left the whole Deno API sitting on it. So the real boundary was never the WASM runtime. It was the line that launched Deno, and that line granted everything:

Prefab at v0.20.2, two files, trimmed
runner.js, header comment:
  The Deno process has --allow-read (to load source) and
  --allow-net (for Pyodide CDN on first run).
  No write, env, or FFI access.

_pyodide.py, launch arguments:
  "--allow-read",
  "--allow-write",
  "--allow-net",

Read the comment and you would sign off on the design. Read the arguments and you would not. A reviewer, an auditor or a model summarising the repository reads the comment, because the comment is written for them. The runtime reads the arguments.

A log line is not a check

PDF Reader MCP is a smaller project and the same story. Set an API key, start the HTTP transport, and the server tells you authentication is enabled. Then it never looks at the header. The advisory's own words for the result are hard to improve on: the misleading startup log made the exposure silent. An operator did the right thing, saw the confirmation, and moved on.

This is worse than a server with no authentication at all, because a server with none at least says so. A false confirmation does not only fail to protect you. It removes the reason anyone would go and look.

Why agent tooling keeps producing this

Agent and MCP tooling is young, moves fast and is assembled from runtimes nobody on the team wrote: Pyodide, Deno, an HTTP framework. Each of those has its own idea of what is allowed, and the security property only exists where they are wired together. That wiring is exactly the code that gets a comment instead of a test. And increasingly the first reader of a repository is a model, which takes a docstring at its word more readily than any human.

Trust is the attack surface

Every security claim in a codebase is an input to somebody's decision: the reviewer who approves it, the operator who deploys it, the agent that installs it. If the claim is not checked by the machine, it is not a control. It is marketing that happens to live in the source tree.

What to actually do

  • Upgrade prefab-ui to 0.21.0 and @sylphx/pdf-reader-mcp to 3.0.1. If you run FastMCP with Generative UI and cannot upgrade today, switch the feature off.
  • Check every host where the old sandbox was reachable. Wherever generate_prefab_ui was exposed, look for .pth files you did not put in site-packages and rotate whatever the server's OS user could read.
  • Test the boundary, not the description. For any sandbox that runs model-written code, keep a test that tries to read a host file and write one from inside it, and fails the build if either works.
  • Prove authentication from outside. After configuring a key, send one request without it and expect a 401. A startup log is not evidence.
  • Treat security comments as claims to verify. When a comment states a permission, a limit or an isolation property, find the line that enforces it. If there is none, the comment is the finding.

E/01What is confirmed
  • CVE-2026-120338, assigned by JFrog and published 1 November 2026: the Generative UI sandbox in the PyPI package prefab-ui (PrefectHQ) runs caller-supplied Python in Pyodide inside a Deno subprocess. Affected from 0.14.0 up to but not including 0.21.0, fixed in 0.21.0 by commit 030f074 (pull request 538).
  • Per that record, the feature is documented as isolation for untrusted code, including LLM-written UI. The launcher started Deno with unrestricted --allow-read, --allow-write and --allow-net, and the runner left the Deno API on the JavaScript global object, which Pyodide's js module proxies, so the Python could call Deno.readTextFileSync and Deno.writeTextFileSync.
  • The record states that a caller who can supply the code can read and write files as the server's OS user and persist code execution by writing a .pth file into the virtualenv's site-packages. The usual remote path it names is FastMCP's GenerativeUI provider, which registers the MCP tool generate_prefab_ui and forwards its code argument into the sandbox. Generative UI is opt-in and the host must have Deno installed.
  • In src/prefab_ui/sandbox/runner.js at v0.20.2, the header comment says the Deno process has --allow-read and --allow-net and "No write, env, or FFI access". In src/prefab_ui/sandbox/_pyodide.py at the same tag, the launch arguments include --allow-read, --allow-write and --allow-net, and the module docstring says code runs inside WASM isolation.
  • At v0.21.0 the runner calls Deno.permissions.revoke for read, write and net after bootstrap and before it accepts code, the launcher adds --no-prompt, and network access is narrowed to cdn.jsdelivr.net:443.
  • Weakness on CVE-2026-120338: CWE-693, protection mechanism failure; CWE-94, code injection; CWE-269, improper privilege management.
  • JFrog's score on CVE-2026-120338: CVSS 3.1 base 10.0, network, no privileges, no user interaction, scope changed.
  • The NVD entry for CVE-2026-120338 carries a CISA SSVC assessment dated 2 November 2026: exploitation none, automatable no, technical impact total.
  • CVE-2026-62264, assigned by GitHub and published 30 October 2026: @sylphx/pdf-reader-mcp from 2.2.0 up to but not including 3.0.1. With MCP_TRANSPORT=http it reads MCP_API_KEY and logs that X-API-Key authentication is enabled, but never validates the header, so the /mcp endpoint accepts unauthenticated clients. The default bind address was 0.0.0.0. The default stdio transport is unaffected.
  • Per the advisory for CVE-2026-62264, 3.0.1 enforces the header with a constant-time comparison and HTTP 401, moves the default bind host to 127.0.0.1 and warns when a non-loopback host runs without a key.
  • Weakness on CVE-2026-62264: CWE-200, CWE-287 and CWE-306, missing authentication for a critical function.
  • GitHub's score on CVE-2026-62264: CVSS 3.1 base 7.5, confidentiality impact only.
  • NVD status on 4 November 2026 for both records: Deferred, with no NVD score of its own.
E/02What we do not yet know
  • Whether either flaw has been exploited. Neither record says so, and we hold no telemetry: our public sensor is offline.
  • How many FastMCP servers have Generative UI switched on with Deno installed, or how many PDF Reader MCP instances run on the HTTP transport. Nobody has published deployment counts.
  • The Prefab project's own GitHub advisory, which the CVE record references. GitHub was out of reach from our tooling and the advisory has no OSV mirror yet, so nothing here rests on it.
  • Whether other Pyodide or WebAssembly sandboxes for model-written code hand the guest the same host bridge. We read only Prefab's runner.
  • We reproduced neither flaw. Everything here rests on the records, the PDF Reader MCP advisory and the Prefab source at the two tags.

E/03Sources
  1. 01CVE-2026-120338 ↗NIST NVD · Primary
  2. 02CVE-2026-120338 record ↗CVE Program · Primary
  3. 03Prefab sandbox launcher at v0.20.2 ↗PrefectHQ/prefab on GitHub · Primary
  4. 04Prefab sandbox runner at v0.20.2 ↗PrefectHQ/prefab on GitHub · Primary
  5. 05Prefab sandbox runner at v0.21.0 ↗PrefectHQ/prefab on GitHub · Primary
  6. 06Fix commit 030f074 ↗PrefectHQ/prefab on GitHub · Primary
  7. 07CVE-2026-62264 ↗NIST NVD · Primary
  8. 08GHSA-q344-5v34-gm84: HTTP transport accepts unauthenticated requests despite a configured MCP_API_KEY ↗SylphxAI/anymd on GitHub · Primary
  9. 09GHSA-q344-5v34-gm84, mirrored ↗OSV