Deno makes two promises. Code gets nothing you don't hand it: no files, no network, no processes. And the runtime is written in Rust, so the memory bugs that sink C and C++ projects are meant to stay out. We handed a script nothing at all. It corrupted Deno's memory anyway, and the deno process became /bin/sh.
Unpatched sandbox escape in Deno 2.8.3 to 2.9.8
No fixed release yet. Run untrusted Deno code behind an OS boundary until one ships.
What you need to know
- What: JavaScript holding no permissions can make Deno run any shell command.
- Who: anything that runs code it didn't write on Deno: dependencies, remote imports, submitted scripts.
- Impact: the command runs as the Deno process's user. On our host that user could reach Docker, which meant root.
- Now: there is no patch. Put untrusted Deno code behind its own user, container or microVM.
Key facts
- Severity Critical, CVSS 9.3
- Permissions needed None. No flags, no prompt, no config
- Attacker Anyone whose JavaScript Deno runs
- Impact Sandbox escape → command execution
- Bug class Double free and use-after-free, in Deno's Rust code
- Proven on Official Deno 2.9.8, Linux x86_64 and arm64
- Affected Deno 2.8.3 to 2.9.8 (latest)
- Fixed in Not fixed
The promise
Start a program with deno run and it gets nothing. Reading a file needs --allow-read. The network needs --allow-net. Starting a process needs --allow-run. That default is the reason teams run npm packages, customer functions and AI-written code on Deno instead of Node.
deno2shell takes the default away. A script with every permission denied makes the deno process run a command of its choosing. Deno keeps answering NotCapable to every direct request. It stops mattering.

Watch it run
A real run on the official Deno 2.9.8 release for Linux x86_64, default flags. Nothing on screen was retyped: every line is the captured output, with long idle waits shortened.
On the right, the attacker's side: the untrusted job, started with deno run --no-prompt and no grants, printing each stage with its real timestamp. On the left, the victim host: the shell that the hijacked Deno process started, working through the machine.
The job leaks where the binary and the heap sit, then takes over a pointer the runtime is about to call. The process becomes /bin/sh, keeps its PID, and reads /etc/hostname, a file the job had no --allow-read for.

The account Deno ran as was in the docker group, as it is on plenty of build and CI machines. docker exec gave uid=0(root). From a privileged container the shell read the host's /etc/shadow and SSH key, wrote a root-owned file into the home directory, and added an /etc/ld.so.preload entry that loads into every program the host starts.

To be precise about where root came from: the escape gives you the user Deno runs as. Docker access on this host did the rest. Without it you still hold every file, secret and socket that account can reach.
Who is the attacker
Whoever wrote JavaScript that your Deno process runs:
- A dependency. One malicious or hijacked npm or jsr package, anywhere in the tree. Your own permission flags don't contain it.
- A remote import from a URL that changes under you.
- Submitted code. Playgrounds, edge functions, AI agent sandboxes, CI and plugin runners all run other people's code by design.
What this is not: a bug you can trigger by sending a request to any Deno server. The attacker's code has to run inside the process. That happens to be the whole job of a dependency, a plugin runner or a code sandbox.
Two ways out
We found two escapes with separate root causes. Both start from JavaScript that holds no permissions, and each needs its own fix.

The HTTP response double free
Deno 2.8.3 added its own HTTP/1.1 server path. A response keeps native state that two objects can end up owning.
- Two owners
Two response objects end up owning the same native state.
- Freed twice
Both release it, so the same memory is freed twice.
- Refilled
The script fills that memory with bytes it chose and learns the memory layout.
- Shell
A pointer the runtime calls later now leads to
/bin/sh -c.
This is the chain in the video. On the official 2.9.8 release it reached the shell in 125 of 125 fresh processes on Linux x86_64, and in every run on arm64 and on a second glibc version. The same job with the aliasing step removed, the CONTROL line in the video, never did.
A fixed bug, back again
In 2024 Deno fixed CVE-2024-27934: low-level runtime functions meant to stay hidden from scripts could be reached and turned into a use-after-free. The fix shipped in Deno 1.40.3.
Since 2.9.0 that fix no longer holds. One denied permission check puts the hidden functions back within reach of unprivileged code. From there a native stream handle is used after it is freed, which gives a controlled write and, again, /bin/sh. We built this chain against the Deno 2.9.8 source, the same code the release ships.
A file read with no permission
A third bug reads any file the Deno user can read, with no --allow-read: SSH keys, cloud tokens, the process's own memory map. A direct readTextFile still fails with NotCapable. The file arrives anyway.
Rust didn't save it
Deno is built in Rust, and people reasonably take that as a guarantee against exactly these bugs. It covers most of the runtime. It can't cover the seams.

Wherever a JavaScript object holds native memory, Deno has to hand V8 a raw pointer and trust the script not to misuse it. That code is unsafe Rust by necessity, because the compiler can't see what JavaScript will do with the pointer. Both escapes live in those seams: native state that two JavaScript objects can claim and both free, and a handle that keeps working after the memory behind it is gone.
The sandbox is only as strong as those few hundred lines. Memory safety elsewhere in the runtime doesn't change that.
Found and proven by a machine
Nobody at OpenSec wrote this exploit. Antara, our white-box harness, read Deno's source, found both escapes and the file read, and built each exploit by itself: the leaks, the memory corruption and the shell you just watched. From the first line of source to uid=0(root), no human was in the loop.
Am I exposed?
Tick what's true. All four means any code that host runs can take over the account Deno runs as.

Am I exposed?
What to do
There is no patched release. The Deno team joined Cloudflare in October 2026 and promised the runtime one last year of monthly bug-fix and security releases. None has shipped since 2.9.8 on 21 October. Update the moment a release lists this fix.
Until then, treat permission flags as a convenience, not a boundary. Assume the code can run any command, and limit what that command can reach.
Take the Deno account out of the docker group
Membership in docker is root by another name. It is what turned a user shell into host root above.
id deno-svc
sudo gpasswd -d deno-svc dockerContainers: no root, no secrets, no network
docker run --rm \
--user 65534:65534 \
--read-only --tmpfs /tmp:rw,noexec,nosuid,size=64m \
-e DENO_DIR=/tmp/deno \
--cap-drop ALL --security-opt no-new-privileges \
--network none \
--pids-limit 64 --memory 512m \
-v "$PWD:/app:ro" \
denoland/deno:2.9.8 run /app/main.tsIf the code needs the network, give it a network that can only reach what it needs. Pass no secrets as -e or mounts, and never mount the Docker socket.
systemd services: confine the unit
[Service]
DynamicUser=yes
NoNewPrivileges=yes
CapabilityBoundingSet=
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
PrivateDevices=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectControlGroups=yes
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
IPAddressDeny=169.254.169.254Then run systemctl daemon-reload and restart the service. A shell started by the escape inherits all of it: no home directories, a read-only system, no new privileges and no cloud metadata.
Keep credentials out of reach
- Move secrets out of the process's environment and off its disk. Fetch short-lived tokens where they are used.
- Block the cloud metadata endpoint,
169.254.169.254, for the Deno user. - Give each service its own cloud role with the least it needs.
Run code that has been reviewed
- Commit
deno.lockand run with--frozen, so a changed dependency fails instead of loading. - Pin remote imports to exact versions, or vendor them.
- Review new and updated dependencies before they ship.
If you run other people's code on Deno
Assume a tenant can leave the sandbox. Give each tenant its own microVM or a gVisor container (--runtime=runsc), not a shared process, and keep nothing in that box you can't afford to lose.
Where it lands
- Self-hosted services on Deno 2.9.x that run untrusted code: playgrounds, agent sandboxes, CI and plugin runners. These carry both escapes today.
- Supabase Edge Functions. Hosted regions run a Deno 2.1-compatible runtime, which predates both bugs. A self-hosted edge runtime moved to 2.9 would carry the same code paths.
- Deno Deploy runs apps with
--allow-all, so permission flags were never the boundary there. Tenant isolation is.
Hunting for it
- Deno starting processes without
--allow-run, especially/bin/shwith a Deno parent. - Deno processes that crash with
SIGSEGV, often several in a row. - Files written outside the paths a Deno process was granted.
- New entries in
/etc/ld.so.preload, and containers started with-v /:/hostthat nobody launched.
Disclosure
We reported both escapes, the file read and three related findings to the Deno team through GitHub Security Advisories, as Deno's security policy asks. No fixed release has shipped, and 2.9.8 is the latest.
We're publishing the impact now, without exploit code, so teams running untrusted code on Deno can isolate it. The full write-up follows once a fix is out.
Timeline
Deno 1.40.3 fixes CVE-2024-27934
Deno 2.8.3 ships the HTTP server path behind the double free
Deno 2.9.0 brings the CVE-2024-27934 class back
The Deno team joins Cloudflare; the runtime gets one more year of monthly fixes
Deno 2.9.8, the latest release
No fix released; impact published without exploit code
Credits
- OpenSec Intelligence: found both escapes and the file read with Antara, which built and proved the exploits end to end, and reported everything to Deno.
