LIVE · cybersecurity feed
Live wire
patch

Researchers escape OpenAI Codex sandbox to run commands on host

Security researchers have identified two distinct sandbox escape vulnerabilities in OpenAI's Codex, a coding agent available as both a command-line interface (CLI) tool and a desktop application. Both flaws, reported to OpenAI on August 12 and subsequently patched within eight days, could allow untrusted code to execute commands on a developer's machine outside the intended sandbox environment.

ZeroDay News ·

Source: BleepingComputer

Photo: European Commission - Photographer: Aurore Martignoni (CC BY 4.0) via Wikimedia Commons

Security researchers have identified two distinct sandbox escape vulnerabilities in OpenAI's Codex, a coding agent available as both a command-line interface (CLI) tool and a desktop application. Both flaws, reported to OpenAI on August 12 and subsequently patched within eight days, could allow untrusted code to execute commands on a developer's machine outside the intended sandbox environment.

The more critical of the two vulnerabilities, dubbed "Heapjack" by researchers at Accomplish AI, affects the Codex Desktop application. This flaw leverages a component named `node_repl`, which is automatically installed and configured in the global `~/.codex/config.toml` file. This configuration is also inherited by Codex CLI users. The `node_repl` component runs a single Node.js process containing two JavaScript execution contexts: one trusted, running OpenAI's code, and one untrusted, executing the agent's code.

The Heapjack attack exploits the fact that both contexts share the same memory heap. The trusted context authenticates itself using a randomly generated token, but this token resides in the shared memory space. An attacker's untrusted code can take a snapshot of the heap using `v8.getHeapSnapshot()` and then identify the token. With the valid token, the untrusted code can then inject its own requests into the communication pipe used by the trusted context to interact with a native, unsandboxed parent process. The parent process, validating the token, then executes the attacker's command. A proof-of-concept demonstrated the ability to launch an application outside Codex's process tree, and researchers noted potential targets like Unix sockets or Docker daemon sockets. This exploit functions even in Codex's strictest "read-only" sandbox mode, where the agent is not supposed to perform any write operations.

The second vulnerability, named "Overpatch," is present in the open-source Codex CLI. In "workspace-write" mode, the agent is designed to restrict write operations to within the project folder. However, the `apply_patch` tool, used by Codex for patching, was found to grant write access to the parent directory of any path specified in a patch. By including a patch that names `/tmp` (thereby granting write access to the root of the disk), an attacker could then use a symlink to append a line to the user's `.zshrc` file in their home directory. The next time the developer opens a terminal, the attacker's command would execute unsandboxed.

Both Heapjack and Overpatch share a common underlying design flaw: the enforcement mechanism for the sandbox was co-located with the code it was meant to restrict. In the case of `apply_patch`, permissions were derived from attacker-controlled input, while `node_repl` stored the trust boundary token in the same memory accessible to untrusted code. This class of vulnerability has been observed in other AI agents, including Cursor, Gemini CLI, and Google's Antigravity, where an agent within its sandbox writes a file that a trusted external tool later executes.

OpenAI has confirmed these issues and released patches. Heapjack was addressed in Codex Desktop build 26.818.21641, and Overpatch was fixed in Codex CLI version 0.149.0. Users are advised to update to these versions or later to mitigate the risks.

patchai
ShareXLinkedInWhatsAppFacebook

More News

view all →
security

Canadian cybersecurity executive arrested in federal extortion case

A Canadian cybersecurity executive was arrested in Pennsylvania on Thursday, facing federal charges of conspiracy to commit extortion. Edward Dubrovsky, 54, a co-founder and former Chief Operating Officer of CYPFER, a firm specializing in ransomware negotiation, is charged with conspiring to threaten the confidentiality of information for extortion and conspiring to commit Hobbs Act extortion,…

breach

Criminal IP Introduces AITEM as the Next Evolution of Attack Surface Management

AI SPERA, the company behind the cyber threat intelligence platform Criminal IP, has announced AITEM (AI-Powered Threat Exposure Management), an expansion of its Attack Surface Management (ASM) offerings. AITEM aims to move beyond traditional asset discovery to provide a more comprehensive approach to understanding, prioritizing, and responding to security exposures. The platform is scheduled…

ai

AI Is Getting Really Good at Messing With Cybercriminals

Anti-cybercrime initiatives are increasingly deploying artificial intelligence to disrupt scammers by engaging them with lifelike bots, which the criminals mistake for genuine victims. This strategy aims to waste scammers' time and resources while gathering intelligence on their operations.

ransomware

FBI Arrests Ransomware Negotiation Firm Co-Founder in ShinyHunters Probe

The Federal Bureau of Investigation (FBI) has reportedly arrested Edward Dubrovsky, a co-founder of the ransomware negotiation firm Cypfer and currently associated with CyberSteward. The arrest is said to be part of the ongoing ShinyHunters investigation, specifically in connection with an incident involving FBI job applicant data.

security

Insider Cyber Extortion Plot Against Industrial Firm Lands Engineer in Prison

A former core infrastructure engineer has been sentenced to prison for an attempted cyber extortion plot against an industrial firm. The engineer reportedly deleted administrative accounts and reset hundreds of user passwords, subsequently demanding a ransom of 20 Bitcoin to prevent further disruption to the company's servers.

ai

The Third-Party Agent Problem: Why Security Built for AI You Chose Misses the Agents You Didn't

A new report highlights a significant blind spot in enterprise security architectures concerning the proliferation of third-party AI agents. The forthcoming 2026 State of Agent Security Report indicates that current security models, often designed to protect AI systems directly chosen and deployed by an organization, frequently fail to account for AI capabilities embedded within third-party…