Skip to content
Heist/ feed
Back to feed
High

Codex has sandbox bypass due to bug in path configuration logic

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2025-59532
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 20:21 UTC · Revision 1

Source evidence

Codex has sandbox bypass due to bug in path configuration logic

core-osv · Original source

Published 22 Sept 2025, 20:26 UTC

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.

osv:CVE-2025-59532
Complete source record
{
  "id": "7efc6a06d03b333a8dab2e5598a197611ccd254e9b4e7dd8da4dffaf7f78977e",
  "url": "https://osv.dev/vulnerability/CVE-2025-59532",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Codex has sandbox bypass due to bug in path configuration logic",
    "summary": "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.",
    "evidence": "osv:CVE-2025-59532",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2025-59532",
      "aliases": [
        "CVE-2025-59532",
        "GHSA-w5fx-fh39-j5rw"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "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"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/openai/codex",
              "type": "GIT",
              "events": [
                {
                  "introduced": "b3bffa594d67dce8fd916dc74b8daea7a2c6f9f3"
                },
                {
                  "fixed": "077623f2e1a9e3d7ad64354383296368bf082f4c"
                },
                {
                  "fixed": "8595237505a1e0faabc2af3db805b66ce3ae182d"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0.2.0"
                      },
                      {
                        "fixed": "0.39.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "8595237505a1e0faabc2af3db805b66ce3ae182d"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "077623f2e1a9e3d7ad64354383296368bf082f4c"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "rust-v0.39.0"
                  }
                ]
              }
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-59532.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:39.411805535Z",
      "provider": "osv",
      "references": [
        "https://github.com/openai/codex/releases/tag/rust-v0.39.0",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/59xxx/CVE-2025-59532.json",
        "https://github.com/openai/codex/security/advisories/GHSA-w5fx-fh39-j5rw",
        "https://nvd.nist.gov/vuln/detail/CVE-2025-59532",
        "https://github.com/openai/codex/commit/8595237505a1e0faabc2af3db805b66ce3ae182d"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-20"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/59xxx/CVE-2025-59532.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2025-59532",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 506621,
  "published_at": "2025-09-22T20:26:42.712+00:00"
}