Researchers escape OpenAI Codex sandbox to run commands on host
Researchers found two ways to escape OpenAI Codex sandbox, one allowing host command execution.
Security researchers discovered two vulnerabilities in OpenAI's Codex, enabling sandbox escapes. One, dubbed Heapjack, allowed remote code execution on a developer's machine from the most locked-down sandbox mode by exploiting a shared memory heap in the Node.js process. The second, Overpatch, leveraged Codex's own patch tool in the CLI version to write arbitrary files, including modifying the `.zshrc` file to execute commands on the next terminal launch. Both issues were reported to OpenAI and patched within eight days.
AI summary of the linked source. Not reviewed by an editor. How this works
Run OpenAI?
Get an email when a new story names OpenAI, usually within the hour.
Free. Your list stays private and never appears in a subject line. One click stops it. How Vendor Watch worksPrivacy
The lesson from this incident
Full lessonTwo vulnerabilities in OpenAI's Codex allowed attackers to escape sandboxed environments and execute arbitrary commands on the host machine — one by exploiting a shared memory heap in Node.js (Heapjack), and another by abusing Codex's own patch tool to overwrite shell configuration files (Overpatch). These flaws demonstrate that AI-powered developer tools introduce novel attack surfaces, particularly when sandbox isolation is improperly implemented or when trusted internal tooling can be weaponized. The risk is amplified because developers often run these tools with elevated local privileges, meaning a successful escape grants significant host access. While OpenAI patched both issues within eight days, the vulnerabilities underscore how rapidly evolving AI tooling can outpace security review. Organizations must treat AI development tools with the same scrutiny applied to any third-party code execution environment.
What helps against this
How we list vendors- Application allowlisting
Any program that reaches a computer can run, including ransomware and the remote-access tools attackers bring with them.
- Endpoint detection and response (EDR and XDR)
Malware and hands-on-keyboard attackers on laptops and servers get spotted and stopped.
- AI application security
Prompt injection, data leaks through AI tools and unapproved AI use get caught.