Researchers escape OpenAI Codex sandbox to run commands on host
Researchers found two OpenAI Codex sandbox escapes, including Heapjack, enabling unsandboxed command execution on developer machines; OpenAI fixed both within eight days.
Oren Yomtov of Accomplish AI reported two sandbox escapes in OpenAI Codex on August 12, fixed within eight days in Codex Desktop 26.818.21641 and Codex CLI 0.149.0. Heapjack targets the default-enabled node_repl component in Codex Desktop, whose trusted and untrusted JavaScript contexts share one Node.js memory heap, letting untrusted code dump the heap with v8.getHeapSnapshot(), brute-force the trusted context's UUID token, and issue unsandboxed commands in read-only mode, including reaching Unix sockets like the Docker daemon. Overpatch abuses the Codex CLI's apply_patch tool, which grants write access to parent directories of patch paths, so naming /tmp widens permissions enough to append a malicious line to .zshrc via a symlink into the home directory. Both attacks can trigger when a developer opens an attacker's repository and asks Codex about the code; no in-the-wild exploitation was reported.
- Heapjack leaks a trusted-context token from a shared V8 heap to run unsandboxed commands in read-only mode.
- Overpatch abuses apply_patch parent-directory write grants, naming /tmp to gain disk-root write access.
- Opening an attacker's repository and asking Codex a question can trigger host command execution.
- node_repl is enabled by default in ~/.codex/config.toml with no opt-out for CLI users.
- Fixed in Codex Desktop 26.818.21641 and Codex CLI 0.149.0; no exploitation observed.
- Vendors
- OpenAI
- Products
- CodexCodex DesktopCodex CLI
- Organizations
- Accomplish AIPillar SecurityGoogleBleepingComputer
From the original article
4 min read at bleepingcomputer.com
Researchers escaped OpenAI's Codex sandbox two ways, one running commands on a developer's machine from its most locked-down mode. OpenAI has patched both. [...]
By Ax Sharma · bleepingcomputer.com
A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.