critical

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:

  1. Prefab UI 0.14.0 through 0.20.2 Pyodide-in-Deno js.Deno host escape (CVE-2026-120338 / GHSA-595q-jv4r-q7j9, CVSS 10.0 Critical): PrefectHQ’s prefab-ui executes LLM-generated Python UI code inside Pyodide (Python compiled to WebAssembly) running in a persistent Deno subprocess, most commonly exposed remotely through FastMCP’s GenerativeUI provider (generate_prefab_ui MCP tool). Although the feature was documented as a WASM sandbox with no host write access, PyodideSandbox._start() launched deno run with unrestricted --allow-read, --allow-write, and --allow-net and never revoked those permissions after bootstrap. Because Pyodide’s built-in js FFI module proxies the JavaScript globalThis object, untrusted Python running inside WebAssembly can simply import js and call js.Deno.readTextFileSync() and js.Deno.writeTextFileSync() to read and write arbitrary files as the server OS user, achieving persistent native code execution by writing a .pth startup hook into the host Python virtualenv’s site-packages. Fixed in prefab-ui 0.21.0 (commit 030f074f85).
  2. Beam Cloud Beta9 < worker-0.1.756 / < gateway-0.1.776 Buildah chroot, sandbox file API, and volume mount escapes (CVE-2026-120306, CVE-2026-120307, and CVE-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 (Buildah chroot isolation and ARG environment injection): docker/Dockerfile.worker set BUILDAH_ISOLATION=chroot and layeredBuild.step() ran buildah run without --isolation, leaving tenant Dockerfile RUN commands running as uid 0 with CAP_DAC_OVERRIDE inside the privileged worker pod’s own PID, IPC, and network namespaces. Because /proc/1/root in that shared procfs points to the worker container’s writable root filesystem, a single image build can overwrite the worker’s runc, buildah, or runsc binaries or read its Kubernetes service account token. In addition, layeredBuild appended tenant-declared ARG key-value pairs directly to buildah’s own process environment (extraEnv), allowing a tenant ARG such as LD_PRELOAD or BUILDAH_ISOLATION to execute directly in the worker process.
    • CVE-2026-120307 (getHostPathFromContainerPath traversal to cluster-admin token): The worker’s sandbox file API (upload, download, stat, list, find-in-files, replace-in-files, delete-file) resolved container paths on the host via getHostPathFromContainerPath(). If a path started with a mount destination (such as the default /tmp/.beta9 upload mount), it joined the uncleaned remainder onto mount.Source with filepath.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 to cluster-admin in 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-supplied volume.Id without checking that the workspace owned volume.Id or 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

EcosystemPackage / ProjectCVE / GHSASeverityAffected versionsFixed versionVulnerable component
PyPIprefab-ui (PrefectHQ/prefab)CVE-2026-120338 (GHSA-595q-jv4r-q7j9)CVSS 10.0 Critical>= 0.14.0, <= 0.20.20.21.0 (0.21.1)PyodideSandbox._start() in src/prefab_ui/sandbox/_pyodide.py and src/prefab_ui/sandbox/runner.js
Go / Kubernetesgithub.com/beam-cloud/beta9 (worker)CVE-2026-120306CVSS 9.9 Critical< 0.1.7560.1.756BUILDAH_ISOLATION=chroot in Dockerfile.worker and layeredBuild.step() in pkg/worker/image_build_layered.go
Go / Kubernetesgithub.com/beam-cloud/beta9 (worker)CVE-2026-120307CVSS 9.9 Critical< 0.1.7560.1.756getHostPathFromContainerPath() and ContainerSyncWorkspace() in pkg/worker/container_server.go
Go / Kubernetesgithub.com/beam-cloud/beta9 (gateway and worker)CVE-2026-120308CVSS 9.9 Criticalgateway < 0.1.776, worker < 0.1.756gateway 0.1.776, worker 0.1.756configureVolumes() 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:

  1. _pyodide.py launches Deno with --no-prompt, --no-config, --lock=... --frozen, and --allow-net=cdn.jsdelivr.net:443.
  2. Immediately after runner.js finishes loading pyodide, pydantic, and prefab_ui into the Emscripten virtual filesystem, it revokes all three Deno permissions before accepting any code over stdin, and suppresses Pyodide’s stdout/stderr while tagging every JSON-lines request with a per-call uuid4().hex id:
--- 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.

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:

  1. Mount prefix + .. traversal: Passing /tmp/.beta9/../../../../../../var/run/secrets/kubernetes.io/serviceaccount/token satisfied strings.HasPrefix(containerPath, "/tmp/.beta9/"), stripped /tmp/.beta9, and passed the .. sequence to filepath.Join(mount.Source, ...), which cleaned the path outside mount.Source onto the worker’s root filesystem.
  2. 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/run inside 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 -> /run to the worker pod’s /run/secrets/kubernetes.io/serviceaccount/token (which is bound to cluster-admin in 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
  1. Upgrade prefab-ui to >= 0.21.0 (0.21.1): If you expose FastMCP’s GenerativeUI (generate_prefab_ui) or PyodideSandbox to untrusted prompts or callers on a host where deno is installed, upgrade immediately and inspect the server user’s site-packages directory, ~/.ssh/authorized_keys, and environment for unauthorized modifications. Note that even on >= 0.21.0, the warm Pyodide Python interpreter is shared across run() calls within a single PyodideSandbox instance, so Prefab documents that PyodideSandbox is not per-request tenant isolation.
  2. Upgrade Beta9 to worker >= 0.1.756 and gateway >= 0.1.776: Ensure worker images set BUILDAH_ISOLATION=oci with containernetworking-plugins installed. 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/runsc on worker nodes.

Timeline

  • 2026-03-27 (02:36 UTC) to 2026-06-03 (02:13 UTC): prefab-ui 0.14.0 through 0.20.2 ship on PyPI with PyodideSandbox launching Deno with unrestricted --allow-read, --allow-write, and --allow-net.
  • 2026-10-26 (19:00 UTC): PrefectHQ merges PR #538 (commit 030f074f85) and publishes prefab-ui 0.21.0 to PyPI.
  • 2026-10-28 to 2026-10-30: Beam Cloud merges PR #1897 (commit a28bf12cf0) and tags gateway-0.1.776 and worker-0.1.756.
  • 2026-11-01 (13:18 UTC and 16:18 UTC): NVD publishes CVE-2026-120306, CVE-2026-120307, and CVE-2026-120308 (CVSS 9.9 Critical) for Beta9 and CVE-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