CVE
CVE-2026-120338, CVE-2026-120306, CVE-2026-120307, CVE-2026-120308
CWE
CWE-269, CWE-250, CWE-22, CWE-59, CWE-863
Affected Surface
- PyPI `prefab-ui` (`PrefectHQ/prefab`) versions `>= 0.14.0, <= 0.20.2` (`CVE-2026-120338` / `GHSA-595q-jv4r-q7j9`, CVSS 10.0 Critical, fixed in `0.21.0`)
- FastMCP servers enabling the `GenerativeUI` provider (`generate_prefab_ui` MCP tool) backed by `prefab-ui <= 0.20.2` on hosts with Deno installed
- Go `github.com/beam-cloud/beta9` worker versions `< 0.1.756` and gateway versions `< 0.1.776` (`CVE-2026-120306`, `CVE-2026-120307`, and `CVE-2026-120308`, all CVSS 9.9 Critical)
TL;DR
On 1 November 2026 (13:18 UTC and 16:18 UTC), four critical sandbox-escape vulnerabilities were published in two runtimes built to isolate untrusted AI-generated or multi-tenant code:
- Prefab UI
0.14.0through0.20.2Pyodide-in-Denojs.Denohost escape (CVE-2026-120338/GHSA-595q-jv4r-q7j9, CVSS 10.0 Critical): PrefectHQ’sprefab-uiexecutes LLM-generated Python UI code inside Pyodide (Python compiled to WebAssembly) running in a persistent Deno subprocess, most commonly exposed remotely through FastMCP’sGenerativeUIprovider (generate_prefab_uiMCP tool). Although the feature was documented as a WASM sandbox with no host write access,PyodideSandbox._start()launcheddeno runwith unrestricted--allow-read,--allow-write, and--allow-netand never revoked those permissions after bootstrap. Because Pyodide’s built-injsFFI module proxies the JavaScriptglobalThisobject, untrusted Python running inside WebAssembly can simplyimport jsand calljs.Deno.readTextFileSync()andjs.Deno.writeTextFileSync()to read and write arbitrary files as the server OS user, achieving persistent native code execution by writing a.pthstartup hook into the host Python virtualenv’ssite-packages. Fixed inprefab-ui 0.21.0(commit030f074f85). - Beam Cloud Beta9
< worker-0.1.756/< gateway-0.1.776Buildahchroot, sandbox file API, and volume mount escapes (CVE-2026-120306,CVE-2026-120307, andCVE-2026-120308, all CVSS 9.9 Critical): In the open-source Beta9 GPU/serverless container platform (github.com/beam-cloud/beta9), three independent flaws allowed any tenant with a workspace token to take over the privileged Kubernetes worker pod:CVE-2026-120306(Buildahchrootisolation andARGenvironment injection):docker/Dockerfile.workersetBUILDAH_ISOLATION=chrootandlayeredBuild.step()ranbuildah runwithout--isolation, leaving tenantDockerfileRUNcommands running asuid 0withCAP_DAC_OVERRIDEinside the privileged worker pod’s own PID, IPC, and network namespaces. Because/proc/1/rootin that shared procfs points to the worker container’s writable root filesystem, a single image build can overwrite the worker’srunc,buildah, orrunscbinaries or read its Kubernetes service account token. In addition,layeredBuildappended tenant-declaredARGkey-value pairs directly tobuildah’s own process environment (extraEnv), allowing a tenantARGsuch asLD_PRELOADorBUILDAH_ISOLATIONto execute directly in the worker process.CVE-2026-120307(getHostPathFromContainerPathtraversal tocluster-admintoken): The worker’s sandbox file API (upload,download,stat,list,find-in-files,replace-in-files,delete-file) resolved container paths on the host viagetHostPathFromContainerPath(). If a path started with a mount destination (such as the default/tmp/.beta9upload mount), it joined the uncleaned remainder ontomount.Sourcewithfilepath.Join(), allowing..segments after/tmp/.beta9/to walk out to any path on the worker; if it matched no mount, it opened the path directly in the worker’s filesystem namespace so absolute symlinks inside the container (such as/var/run -> /run) resolved against the worker root, exposing/var/run/secrets/kubernetes.io/serviceaccount/token(bound tocluster-adminin the shipped remote-node manifests).CVE-2026-120308(Unchecked volume ID bind-mount escape and cross-tenant volume access): When deploying a function, endpoint, or task queue,GatewayService.configureVolumes()joined the shared volumes root, workspace name, and caller-suppliedvolume.Idwithout checking that the workspace ownedvolume.Idor rejecting..segments, allowing a tenant to bind-mount the worker’s root filesystem (/) or other tenants’ volumes read-write into their sandbox.
What to do now: Upgrade prefab-ui to >= 0.21.0 (0.21.1 is current on PyPI) and restart any FastMCP or Python processes running PyodideSandbox. Upgrade Beam Cloud Beta9 workers to >= worker-0.1.756 and gateways to >= gateway-0.1.776, and audit Kubernetes worker nodes and host virtualenvs for unauthorized .pth files or cluster-admin service-account token use.
Affected packages and projects
| Ecosystem | Package / Project | CVE / GHSA | Severity | Affected versions | Fixed version | Vulnerable component |
|---|---|---|---|---|---|---|
| PyPI | prefab-ui (PrefectHQ/prefab) | CVE-2026-120338 (GHSA-595q-jv4r-q7j9) | CVSS 10.0 Critical | >= 0.14.0, <= 0.20.2 | 0.21.0 (0.21.1) | PyodideSandbox._start() in src/prefab_ui/sandbox/_pyodide.py and src/prefab_ui/sandbox/runner.js |
| Go / Kubernetes | github.com/beam-cloud/beta9 (worker) | CVE-2026-120306 | CVSS 9.9 Critical | < 0.1.756 | 0.1.756 | BUILDAH_ISOLATION=chroot in Dockerfile.worker and layeredBuild.step() in pkg/worker/image_build_layered.go |
| Go / Kubernetes | github.com/beam-cloud/beta9 (worker) | CVE-2026-120307 | CVSS 9.9 Critical | < 0.1.756 | 0.1.756 | getHostPathFromContainerPath() and ContainerSyncWorkspace() in pkg/worker/container_server.go |
| Go / Kubernetes | github.com/beam-cloud/beta9 (gateway and worker) | CVE-2026-120308 | CVSS 9.9 Critical | gateway < 0.1.776, worker < 0.1.756 | gateway 0.1.776, worker 0.1.756 | configureVolumes() in pkg/gateway/services/stub.go and ConfigureContainerRequestMounts() in pkg/abstractions/common/mount.go |
Technical analysis
1. Prefab UI 0.14.0 to 0.20.2: why Pyodide WASM inside Deno is not a sandbox when js.Deno retains host permissions (CVE-2026-120338)
Prefab UI’s Generative UI feature executes LLM-generated Python UI scripts (typically passed into FastMCP’s generate_prefab_ui MCP tool) inside a persistent Deno subprocess running Pyodide. Prior to version 0.21.0, the documentation stated:
“Code runs inside Pyodide’s WASM sandbox. The Deno process has read-only filesystem access (to load Prefab source) and network access (for the Pyodide CDN on first run). It has no write, environment variable, or FFI access.”
In reality, PyodideSandbox._start() in src/prefab_ui/sandbox/_pyodide.py spawned deno run with full --allow-read, --allow-write, and --allow-net flags so Pyodide could read the local prefab_ui Python source tree and cache downloaded wheels on startup:
--- a/src/prefab_ui/sandbox/_pyodide.py
+++ b/src/prefab_ui/sandbox/_pyodide.py
@@ -72,10 +75,14 @@ async def _start(self) -> None:
[
deno,
"run",
+ "--no-config",
+ f"--lock={DENO_LOCK}",
+ "--frozen",
"--unstable-detect-cjs",
+ "--no-prompt",
"--allow-read",
"--allow-write",
- "--allow-net",
+ "--allow-net=cdn.jsdelivr.net:443",
str(RUNNER_JS),
str(PREFAB_SRC),
],
WebAssembly isolates linear memory, not the host APIs imported into the JavaScript runtime. In Pyodide, Python code has a built-in bridge module named js that proxies properties on the JavaScript global object (globalThis). Because runner.js ran inside Deno (globalThis.Deno) and never revoked the bootstrap permissions before entering the stdin request loop, any Python snippet passed to sandbox.run() or the generate_prefab_ui MCP tool could reach out through js.Deno:
import js
# Read arbitrary files on the host OS as the server user
secrets = js.Deno.readTextFileSync("/proc/self/environ")
# Persist native Python code execution outside WASM by dropping a .pth file
# into the server virtualenv's site-packages directory
js.Deno.writeTextFileSync(
"/app/.venv/lib/python3.12/site-packages/pwn.pth",
"import os; os.system('...')\n",
)
In addition, before 0.21.0, runner.js did not suppress Pyodide’s stdout or correlate request IDs, meaning a print('{"result": ...}') statement inside generated Python could inject a fake JSON-lines frame onto the Deno subprocess’s stdout pipe and desynchronize subsequent responses across callers.
Commit 030f074f85 (PR #538, released in prefab-ui 0.21.0) fixes both issues:
_pyodide.pylaunches Deno with--no-prompt,--no-config,--lock=... --frozen, and--allow-net=cdn.jsdelivr.net:443.- Immediately after
runner.jsfinishes loadingpyodide,pydantic, andprefab_uiinto the Emscripten virtual filesystem, it revokes all three Deno permissions before accepting any code overstdin, and suppresses Pyodide’sstdout/stderrwhile tagging every JSON-lines request with a per-calluuid4().hexid:
--- a/src/prefab_ui/sandbox/runner.js
+++ b/src/prefab_ui/sandbox/runner.js
@@ -94,6 +102,15 @@ def _execute_prefab(_code, _data):
await pyodide.runPythonAsync(HARNESS);
+// Bootstrap is complete: ordinary Prefab code uses the mounted virtual
+// filesystem and preloaded packages. Do not retain bootstrap I/O permissions
+// while executing generated code.
+for (const name of ["read", "write", "net"]) {
+ await Deno.permissions.revoke({ name });
+}
+
+console.error("pyodide:ready");
2. Beam Cloud Beta9: Buildah chroot worker escape (CVE-2026-120306), getHostPathFromContainerPath traversal (CVE-2026-120307), and volume bind-mount escape (CVE-2026-120308)
In beam-cloud/beta9 prior to worker-0.1.756 and gateway-0.1.776, commit a28bf12cf0 (PR #1897) closes three distinct container-to-worker escapes:
A. BUILDAH_ISOLATION=chroot and tenant ARG injection into buildah (CVE-2026-120306)
When a tenant submits an image definition (where Clip v2 layered builds are the default), the Beta9 worker executes each RUN step via Buildah. However, docker/Dockerfile.worker set ENV BUILDAH_ISOLATION=chroot, and layeredBuild.step() in pkg/worker/image_build_layered.go invoked buildah run without an --isolation flag. Under chroot isolation, Buildah only calls chroot(2) into the image layer. It does not create new PID, IPC, network, or user namespaces. Because the Beta9 worker pod itself runs as privileged (uid 0, CAP_DAC_OVERRIDE), every tenant RUN command executed in the worker pod’s PID namespace where PID 1 is the worker entrypoint. Consequently, /proc/1/root inside the build step was a writable handle to the worker container’s own root filesystem (containing the worker’s runc, buildah, and runsc binaries, host mounts, and Kubernetes service account token).
Worse still, to pass Dockerfile ARG values into buildah run, layeredBuild.step() passed --env NAME on the command line and appended NAME=VALUE (extraEnv) to the host buildah process’s own environment:
--- a/pkg/worker/image_build_layered.go
+++ b/pkg/worker/image_build_layered.go
@@ -166,19 +162,19 @@ func (b *layeredBuild) step(step dockerfileStep) error {
switch step.kind {
case stepRun:
args := b.storageArgs("run")
+ args = append(args, buildahIsolationArgs()...)
for _, volume := range b.runVolumes {
args = append(args, "--volume", volume)
}
// ARG values reach RUN as environment without persisting in the
// image, and only once the Dockerfile has declared them, as with
- // Docker. They are handed over through buildah's own environment
- // (--env NAME) so secrets stay off the command line.
- var extraEnv []string
+ // Docker. They go to the build container only: in buildah's own
+ // environment a tenant-named ARG such as LD_PRELOAD or
+ // BUILDAH_ISOLATION would act on the worker.
for name := range b.declaredArgs {
value, given := b.buildArgs[name]
if _, isEnv := b.env[name]; given && !isEnv {
- args = append(args, "--env", name)
- extraEnv = append(extraEnv, name+"="+value)
+ args = append(args, "--env", name+"="+value)
}
}
As the patch comment and regression test (TestLayeredBuildRunIsIsolatedFromWorker) note, declaring ARG LD_PRELOAD in a tenant build injected LD_PRELOAD=/tenant.so directly into the worker’s buildah execution environment. The fix switches Dockerfile.worker to BUILDAH_ISOLATION=oci, installs containernetworking-plugins, enforces --isolation=oci --pid=private --ipc=private --network=private (buildahIsolationArgs()) on both RUN steps and WORKDIR creation, and passes --env name=value only into the container.
B. getHostPathFromContainerPath mount-prefix traversal and symlink escape (CVE-2026-120307)
The Beta9 worker serves sandbox file operations (upload, download, stat, list, find-in-files, replace-in-files, delete-file) from outside the container by translating the tenant’s container path into a worker host path. Previously, getHostPathFromContainerPath() in pkg/worker/container_server.go checked whether the uncleaned containerPath began with a mount destination (such as /tmp/.beta9) before calling filepath.Join():
// Vulnerable implementation removed in commit a28bf12cf0:
func (s *ContainerRuntimeServer) getHostPathFromContainerPath(containerPath string, instance *ContainerInstance) string {
// Check mounts first
for _, mount := range instance.Spec.Mounts {
if containerPath == mount.Destination || strings.HasPrefix(containerPath, mount.Destination+"/") {
relativePath := strings.TrimPrefix(containerPath, mount.Destination)
return filepath.Join(mount.Source, strings.TrimPrefix(relativePath, "/"))
}
}
// Use root path (already set to overlay merged path in lifecycle.go)
return filepath.Join(instance.Spec.Root.Path, strings.TrimPrefix(filepath.Clean(containerPath), "/"))
}
This helper failed in two ways:
- Mount prefix +
..traversal: Passing/tmp/.beta9/../../../../../../var/run/secrets/kubernetes.io/serviceaccount/tokensatisfiedstrings.HasPrefix(containerPath, "/tmp/.beta9/"), stripped/tmp/.beta9, and passed the..sequence tofilepath.Join(mount.Source, ...), which cleaned the path outsidemount.Sourceonto the worker’s root filesystem. - Absolute symlink resolution in the worker’s mount namespace: For paths not matching a mount (e.g.,
/var/run/secrets/kubernetes.io/serviceaccount/token),filepath.Join(instance.Spec.Root.Path, ...)produced<rootfs>/var/run/secrets/...on the worker. Because/var/runinside a standard Linux container rootfs is an absolute symlink to/run, when the worker process opened<rootfs>/var/run/secrets/...in its own filesystem namespace, the kernel followed/var/run -> /runto the worker pod’s/run/secrets/kubernetes.io/serviceaccount/token(which is bound tocluster-adminin Beta9’s remote-node manifests).
Commit a28bf12cf0 deletes getHostPathFromContainerPath() and rewrites all sandbox file operations and ContainerSyncWorkspace() around Go 1.24’s os.OpenRoot(), which confines all path lookups and symlink resolutions inside the opened directory descriptor (O_RESOLVE_BENEATH).
C. Unvalidated volume ID bind-mount escape (CVE-2026-120308)
When a tenant attached a volume to a function, endpoint, or task queue, GatewayService.configureVolumes() in pkg/gateway/services/stub.go did not verify that volume.Id belonged to workspace.Id or reject / and .. segments before ConfigureContainerRequestMounts() joined volume.Id onto the shared host volumes path. Supplying volume.Id = "../../.." collapsed the joined host path to / on the worker and bind-mounted the worker’s root filesystem read-write into the tenant’s sandbox; supplying another tenant’s volume identifier mounted that tenant’s volume. Commit a28bf12cf0 adds abstractions.ValidateVolume() (rejecting empty IDs, ., .., and / in v.Id, as well as .. in v.MountPath) and enforces gws.backendRepo.GetVolumeByExternalId(ctx, workspace.Id, volume.Id) before configuring any mount.
Detection and remediation
# 1. Check Python environments and lockfiles for vulnerable prefab-ui (0.14.0 through 0.20.2)
pip show prefab-ui 2>/dev/null || true
rg -n 'prefab-ui|prefab_ui|GenerativeUI|generate_prefab_ui' \
pyproject.toml uv.lock requirements*.txt poetry.lock 2>/dev/null
# 2. If running prefab-ui <= 0.20.2 with Deno installed, audit site-packages for unexpected .pth files
find / -path '*/site-packages/*.pth' -mtime -30 2>/dev/null || true
# 3. Check Beam Cloud Beta9 worker and gateway versions / container images
rg -n 'beam-cloud/beta9|BUILDAH_ISOLATION' go.mod Dockerfile* *.yaml *.yml 2>/dev/null
- Upgrade
prefab-uito>= 0.21.0(0.21.1): If you expose FastMCP’sGenerativeUI(generate_prefab_ui) orPyodideSandboxto untrusted prompts or callers on a host wheredenois installed, upgrade immediately and inspect the server user’ssite-packagesdirectory,~/.ssh/authorized_keys, and environment for unauthorized modifications. Note that even on>= 0.21.0, the warm Pyodide Python interpreter is shared acrossrun()calls within a singlePyodideSandboxinstance, so Prefab documents thatPyodideSandboxis not per-request tenant isolation. - Upgrade Beta9 to
worker >= 0.1.756andgateway >= 0.1.776: Ensure worker images setBUILDAH_ISOLATION=ociwithcontainernetworking-pluginsinstalled. If untrusted tenants had workspace tokens on< 0.1.756, rotate the worker’s Kubernetes service-account tokens, audit Kubernetes API server logs for calls made by the worker’s service account, and verify the integrity of/usr/bin/runc,/usr/bin/buildah, and/usr/local/bin/runscon worker nodes.
Timeline
- 2026-03-27 (
02:36 UTC) to 2026-06-03 (02:13 UTC):prefab-ui0.14.0through0.20.2ship on PyPI withPyodideSandboxlaunching Deno with unrestricted--allow-read,--allow-write, and--allow-net. - 2026-10-26 (
19:00 UTC): PrefectHQ merges PR#538(commit030f074f85) and publishesprefab-ui 0.21.0to PyPI. - 2026-10-28 to 2026-10-30: Beam Cloud merges PR
#1897(commita28bf12cf0) and tagsgateway-0.1.776andworker-0.1.756. - 2026-11-01 (
13:18 UTCand16:18 UTC): NVD publishesCVE-2026-120306,CVE-2026-120307, andCVE-2026-120308(CVSS 9.9 Critical) for Beta9 andCVE-2026-120338/GHSA-595q-jv4r-q7j9(CVSS 10.0 Critical) for Prefab UI.
From research to remediation
Check whether this pattern exists in your codebase
Turn this research into a remediation workflow. Scan dependencies and package manifests for similar supply-chain risk, then prioritize fixes with reachability context.
References
- NVD: CVE-2026-120338 (Prefab UI Generative UI Pyodide/Deno sandbox escape)
- PrefectHQ/prefab commit 030f074f85 (PR #538: Revoke sandbox bootstrap permissions before execution)
- NVD: CVE-2026-120306, CVE-2026-120307, and CVE-2026-120308 (Beam Cloud Beta9 worker and gateway escapes)
- beam-cloud/beta9 commit a28bf12cf0 (PR #1897: Handle sandbox edge cases)
- beam-cloud/beta9 release worker-0.1.756 and gateway-0.1.776