Security1 publisher3 min readPublished
Opening a stranger's repo in OpenAI Codex handed its author commands on the host
Oren Yomtov of Accomplish AI found two escapes from the Codex sandbox. The worse one ran unsandboxed commands from read-only mode through a helper tool that Codex Desktop writes into the global config at install.
The Watch · Security desk

What happened
- Opening someone else's repository in OpenAI Codex and asking a question about the code was enough to give the repository's author unsandboxed command execution on the developer's machine.
- Codex Desktop writes the component the attack abuses, node_repl, into the global ~/.codex/config.toml at install. Users never opt in and cannot turn it off, and plain CLI users inherit it unasked.
- The escape works from Codex's most locked-down mode. Codex does not prompt for approval, and nothing appears on screen while it runs.
- A second flaw, Overpatch, used Codex CLI's own apply_patch tool. apply_patch grants write access to the parent folder of every path a patch names, so naming /tmp opened the root of the disk.
- Oren Yomtov of Accomplish AI reported both bugs on August 12, and OpenAI fixed Heapjack in Codex Desktop build 26.818.21641 and Overpatch in Codex CLI 0.149.0.
Compiled by The WatchSomething wrong?How this is made
Why it matters
- exposure Reading a stranger's code in Codex put the reviewer's Unix sockets, including a Docker daemon socket, and the global config file in reach of whoever wrote that code.
- constraint While Heapjack worked, read-only mode could not be counted as containment for untrusted code. A disposable host was the only boundary a reviewer could rely on.
- decision Teams pinning agent versions have to track the Desktop build and the CLI release separately, because patching one client leaves the other on vulnerable code.
- precedent With Pillar's July 2026 results and these two bugs, in-process enforcement is the repeating failure in agent sandboxes. Each newly shipped privileged helper tool is the next place to look.
node_repl runs one Node.js process that holds two JavaScript contexts. One is trusted and carries OpenAI's own code; the other is untrusted and carries the agent's. The trusted side proves itself to a native parent process with a random token generated fresh on each run [5]. Both contexts share one memory heap, so the token is a string the untrusted side can read [6]. The untrusted code takes a snapshot of that heap with v8.getHeapSnapshot() and tries every string shaped like a UUID. A wrong guess returns "not authorized". A correct token with a bad argument returns a real validation error, and the attacker keeps that one [7].
With the token, the untrusted code writes its own request onto the same pipe the trusted context uses to talk to the native, unsandboxed parent, and the parent checks the token and runs the request [8]. The proof of concept called the system open command to launch an application outside Codex's process tree entirely, and the same access reaches any Unix socket on the machine, a Docker daemon socket being the obvious target, along with a tool for editing the global config file [9].
Overpatch is cruder and sits in the open-source CLI. In workspace-write mode the agent may only write inside the project folder, and a shell command aimed at the home directory is refused [11]. The researchers went through apply_patch instead. The working exploit pairs the /tmp hunk with a second change that appends a line to .zshrc through a symlink into the home directory; remove the /tmp hunk and the write is refused [13]. The next terminal the developer opens runs the attacker's line unsandboxed [13].
Both bugs put the enforcement inside the thing being enforced [14]. apply_patch worked out its own permissions from attacker-supplied input, and node_repl kept the secret dividing trusted from untrusted code in memory the untrusted code could read [14]. Pillar Security showed a relative of this in July 2026 across Cursor, Codex, Gemini CLI and Google's Antigravity, where an agent that stays inside its sandbox writes a file that a trusted tool outside the sandbox later runs [15].
An anonymous reply to Yomtov's post on X wrote that "V8 contexts isolate globals, not memory, so the sandbox was really a promise the heap never agreed to" [17]. A second anonymous reply to the same post called the trust boundary "a room divider" [18].
Yomtov says both bugs went to OpenAI on August 12 and were fixed within eight days [2][19]. Eight days puts the patched code on or before August 20. The fixes shipped in two separate products, so the version to check depends on which client is installed [16][20]. Working out whether a machine ever carried the vulnerable tool means reading ~/.codex/config.toml [4][21].
What to watch
- Whether OpenAI adds a setting to disable node_repl, or stops writing it into the global config at install.
- Any report of Heapjack or Overpatch being used against a developer machine outside the researchers' proof of concept.
- Whether the shared-heap token pattern turns up in other agents' privileged helper processes after Pillar's July 2026 cross-tool results.