INCIDENT MAP

Browse / Improper Output Handling / CVE-2025-59532

Codex has sandbox bypass due to bug in path configuration logic

CVE-2025-59532 · 2025-09-19 high

Class
Improper Output Handling (filed by a model that read the advisory)
Technique
Sandbox escape
Also involves
Tool and Agent Misuse
Affected
@openai/codex (npm)
Gets past
Path restriction
CVSS
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
EPSS
0.9% chance of exploitation in 30 days

How it works, in short

A model-supplied working directory was accepted as the sandbox's writable root, letting generated commands write outside the session workspace. (Our summary, written by a model. The source text is below.)

Details

Due to a bug in the sandbox configuration logic, Codex CLI could treat a model-generated cwd as the sandbox’s writable root, including paths outside of the folder where the user started their session.

This logic bypassed the intended workspace boundary and enables arbitrary file writes and command execution where the Codex process has permissions - this did not impact the network-disabled sandbox restriction.

Remediation
We released a patch in Codex CLI 0.39.0 that canonicalizes and validates that the boundary used for sandbox policy is based on where the user started the session, and not the one generated by the model. Users running 0.38.0 or earlier should update immediately via their package manager or by reinstalling the latest Codex CLI to ensure sandbox boundaries are enforced.

If using the Codex IDE extension, users should immediately update to 0.4.12 for a fix of the sandbox issue.

Thank you to Tzanko Matev (Codetracer) for reporting the issue!

References

Source: GitHub Advisory Database, used under CC BY 4.0.