Deno: zero-permission JavaScript escapes sandbox to shell "deno2shell"
Severity: critical · Patch status: unpatched · Since 2026-12-01
OpenSec Intelligence disclosed on 2026-12-01 that JavaScript running with no Deno permission flags can run arbitrary shell commands, or read files without --allow-read, in Deno 2.8.3 through 2.9.8, the latest release (2026-10-21). OpenSec describes two memory-corruption escapes. The first is a double free in the HTTP/1.1 server response path, introduced in 2.8.3 (released 2026-06-11). The second is a regression of the CVE-2024-27934 bug class, which OpenSec says returned in 2.9.0 (released 2026-06-25) when a denied permission check exposes internal functions that lead to a native stream use-after-free. OpenSec separately reports a file read that needs no --allow-read. It says it reproduced the shell escape on the official 2.9.8 Linux x8664 and arm64 builds, and that the attacker's JavaScript must run inside the Deno process, for example as a dependency, remote import or submitted script, so an ordinary HTTP request is not enough. On OpenSec's test host, escalation to root went through the Deno service account being in the docker group. OpenSec rates it CVSS 9.3, has withheld exploit code, reported the bugs privately through GitHub Security Advisories on 2026-11-20, and says Deno has not replied. No CVE, published GitHub advisory, patched release or in-the-wild use was found in the sources reviewed. Until a fix ships, Deno permission flags are not a security boundary: run untrusted code under its own OS user, container, gVisor or microVM, take the Deno account out of the docker group, and keep secrets out of the process.
What to do
- Check Deno versions across servers, CI runners, and sandboxes (deno --version); treat any 2.8.3 through 2.9.8 deployment running untrusted or third-party code as exposed.
- Remove the Deno service account from the docker group (sudo gpasswd -d <user> docker) and never mount /var/run/docker.sock into a Deno container.
- Do not rely on Deno permission flags as a security boundary until a patched release ships; isolate untrusted Deno workloads in separate microVMs, gVisor (--runtime=runsc), or locked-down rootless read-only containers (--cap-drop ALL --security-opt no-new-privileges --network none --read-only).
- Enforce kernel-level execution and egress confinement outside the Deno process (for example systemd NoExecPaths=/ + ExecPaths= or eBPF LSM bprm_check_security and per-cgroup egress allowlists) and block access to cloud metadata at 169.254.169.254.
- Pin dependencies with committed deno.lock and --frozen, remove secrets from the Deno process environment and disk, and hunt for deno spawning /bin/sh or /usr/bin/dash, repeated Deno SIGSEGV crashes, and unexpected /etc/ld.so.preload entries.
Sources
All live incidents on Threat Watch