Back to Feed
VulnerabilitiesSep 20, 2026

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

Vendor Watch

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 lesson

Two 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

Entities

Codex (product)OpenAI (vendor)Node.js (technology)sandbox (technology)