CVE-2025-59532
JSON

8.6high

Codex has sandbox bypass due to bug in path configuration logic

Severity
8.6high CVSS:4.0 by GitHub_M
Exploit likelihood
0.98% (higher than 61% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-w5fx-fh39-j5rw

Description

Codex CLI is a coding agent from OpenAI that runs locally. In versions 0.2.0 to 0.38.0, 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. This issue has been patched 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.

Affected

Product or packageVersionsReported by
openai codex>= 0.2.0, < 0.39.0CVE List
@openai/codex (npm)from 0.2.0 before 0.39.0GitHub Advisory Database

All scores

GitHub_M8.6high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Classification

CWE-20

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

Codex CLI is a coding agent from OpenAI that runs locally. In versions 0.2.0 to 0.38.0, 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. This issue has been patched 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.

GitHub Advisory Database

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!

NVD (es)

Codex CLI es un agente de codificación de OpenAI que se ejecuta localmente. En las versiones 0.2.0 a 0.38.0, debido a un error en la lógica de configuración del sandbox, Codex CLI podría tratar un cwd generado por el modelo como la raíz escribible del sandbox, incluyendo rutas fuera de la carpeta donde el usuario inició su sesión. Esta lógica eludió el límite de espacio de trabajo previsto y permite escrituras de archivos arbitrarias y ejecución de comandos donde el proceso de Codex tiene permisos - esto no tuvo impacto en la restricción del sandbox con red deshabilitada. Este problema ha sido parcheado en Codex CLI 0.39.0 que canoniza y valida que el límite utilizado para la política del sandbox se basa en donde el usuario inició la sesión, y no en el generado por el modelo. Los usuarios que ejecutan la versión 0.38.0 o anterior deben actualizar inmediatamente a través de su gestor de paquetes o reinstalando la última versión de Codex CLI para asegurar que se apliquen los límites del sandbox. Si utilizan la extensión de Codex IDE, los usuarios deben actualizar inmediatamente a la versión 0.4.12 para una corrección del problema del sandbox.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-59532 changed 2025-09-23CVE Terms of Use
GitHub Advisory DatabaseGHSA-w5fx-fh39-j5rw changed 2025-09-22CC-BY-4.0
NVDCVE-2025-59532 changed 2026-10-11Public domain