<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1950087345534883&amp;ev=PageView&amp;noscript=1">
Skip to content

CVE-2026-19591: OpenAI Codex Command Safety Bypass - What It Means for Your Business and How to Respond

Introduction

A high-severity vulnerability in OpenAI’s Codex CLI and Desktop tools has been disclosed that can allow attackers to execute unauthorized code when a user opens a prepared repository. Organizations that equip developers, engineers, or security teams with these AI coding assistants face elevated risk if unpatched versions remain in use. The issue affects Windows, macOS, and Linux environments and carries a CVSS score of 8.8. This post explains the business implications, helps you determine whether your environment is exposed, outlines practical response steps, and provides a technical appendix for security and IT teams. Understanding and addressing this vulnerability promptly reduces the chance of unauthorized access to source code, credentials, or sensitive files on developer workstations across the United States and Canada.

S1 — Background & History

OpenAI disclosed CVE-2026-19591 on September 1, 2026. The vulnerability affects OpenAI Codex CLI versions 0.72.0 through 0.130.0 and multiple Codex Desktop builds for Windows and macOS. It was reported through coordinated disclosure channels, with public credit later given to researchers from Compass Security via the Zero Day Initiative. The issue received a CVSS 3.1 base score of 8.8 (High). In plain language, the tool’s safety checks incorrectly treated certain PowerShell commands as safe. This allowed a carefully crafted repository to trigger file-writing Git operations without the usual user approval prompt. On macOS and Linux the attack additionally requires PowerShell Core to be present. Once configuration files can be altered, an attacker-controlled MCP server can later run with the privileges of the logged-in user. Patches were released in Codex CLI 0.131.0 and corresponding Desktop versions shortly after disclosure.

S2 — What This Means for Your Business

If your developers rely on OpenAI Codex to accelerate coding, review code, or automate tasks, this vulnerability creates a realistic path for an attacker to gain the same level of access those developers possess. A successful exploit can lead to theft or alteration of source code, exposure of API keys and credentials stored on the machine, or installation of persistent tools. Operational disruption can occur if compromised workstations are taken offline for investigation or if malicious changes propagate into shared repositories. Reputation damage follows if customer data or proprietary intellectual property is leaked. Organizations subject to data-protection rules in the United States and Canada, including those handling personal information under state privacy laws or PIPEDA, may face reporting obligations and potential regulatory scrutiny if the incident results in unauthorized access to regulated data. The requirement for user interaction means the risk is highest in environments where developers routinely clone or open third-party or untrusted repositories.

S3 — Real-World Examples

Regional Bank Development Team: A developer at a mid-sized regional bank opens a repository shared by an external consultant that appears to contain useful automation scripts. Codex processes the repository and silently modifies its own configuration. Later sessions launch attacker-controlled tooling that exfiltrates internal source code and API credentials used for banking systems, triggering incident response and potential regulatory notification.

Software Startup Engineering Group: Engineers at a growth-stage startup frequently experiment with open-source projects and AI-assisted coding. An attacker publishes a repository that looks like a helpful library. When a junior developer opens it with an unpatched Codex Desktop client, the configuration is altered. Subsequent code-execution activity allows the attacker to plant backdoors in the company’s private repositories before detection.

Healthcare Technology Firm: A developer supporting electronic health record integrations uses Codex CLI on a workstation that also holds test data and configuration files. Opening a malicious repository enables the attacker to read files accessible to that user account. Even limited filesystem sandboxing may not fully prevent access to credentials or sample patient-related data stored locally, creating both operational and compliance exposure.

Managed Service Provider: Consultants at an MSP use Codex across multiple client environments. A single compromised workstation becomes a pivot point when the altered configuration allows further tool execution, potentially exposing client credentials or infrastructure details stored on the consultant’s machine.

S4 — Am I Affected?

  • You are running OpenAI Codex CLI version 0.72.0 through 0.130.0 on Windows, macOS, or Linux.
  • You are running an affected Codex Desktop build (macOS versions from 260202.0859 through 26.513.31313, or corresponding Windows builds prior to the fixed releases).
  • Developers or engineers in your organization open external, third-party, or untrusted Git repositories while using Codex.
  • PowerShell Core (pwsh) is installed on macOS or Linux systems that also run Codex.
  • Codex configuration files or MCP server settings can be written by the user account running the tool.
  • You have not yet upgraded to Codex CLI 0.131.0 or later, or the corresponding fixed Desktop versions.

Key Takeaways

  • CVE-2026-19591 allows an attacker who can induce a user to open a prepared repository to bypass Codex approval checks and potentially achieve code execution with the user’s privileges.
  • Business impact centers on loss of source code confidentiality, credential exposure, operational disruption, and possible regulatory consequences in the United States and Canada.
  • Only specific older versions of Codex CLI and Desktop are affected; upgrading eliminates the vulnerability.
  • User interaction is required, so risk is highest where developers routinely work with external repositories.
  • Prompt inventory of Codex usage and prioritization of the official patches form the core of an effective response.

Call to Action

Confirm whether OpenAI Codex is present in your environment and apply the available updates without delay. For a thorough assessment of residual risk, including related AI-tooling and developer-workstation exposures, contact IntegSec for a professional penetration test. Our team helps organizations in the United States and Canada identify and reduce practical attack paths before they are exploited. Visit https://integsec.com to schedule a discussion.

TECHNICAL APPENDIX (security engineers, pentesters, IT professionals only)

A — Technical Analysis

The root cause is improper handling of PowerShell’s stop-parsing token (--%) inside Codex’s command-safety parser. The parser lowered PowerShell AST elements into an argv-like representation that did not correctly model the stop-parsing semantics used by PowerShell itself. Certain command forms were therefore classified as safe when they should have required approval. The affected component is the command-safety and shell-command handling logic in Codex CLI and the corresponding Desktop applications. The attack vector is network-delivered (malicious repository) with low attack complexity, no privileges required, and required user interaction (opening the repository). Scope is unchanged. The CVSS 3.1 vector is AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H. The associated CWE is CWE-150 (Improper Neutralization of Escape, Meta, or Control Sequences). Official record: https://www.cve.org/CVERecord?id=CVE-2026-19591. On macOS and Linux, successful exploitation additionally requires a separately installed PowerShell Core binary. The approval bypass does not itself disable the default filesystem sandbox; writes outside permitted locations may still be blocked depending on local configuration.

B — Detection & Verification

[BOTH]

Version enumeration:

  • Codex CLI: codex --version or inspect the installed package metadata (npm global or local installation of @openai/codex).
  • Codex Desktop: check the application’s About dialog or installed package version on Windows and macOS.

Scanner signatures: Look for presence of Codex CLI packages in the vulnerable range (0.72.0–0.130.0) and Desktop builds prior to the fixed releases. Endpoint detection platforms can flag the presence of the vulnerable binaries or configuration directories associated with Codex.

Log indicators: Unexpected Git operations that write files without corresponding user approval prompts in the Codex session logs. Modifications to Codex configuration files (particularly those controlling MCP server settings) occurring outside normal interactive sessions.

Behavioral anomalies: Codex launching or connecting to unexpected MCP servers after a repository has been opened. File-write activity targeting Codex configuration paths immediately after processing an untrusted repository.

Network exploitation indicators: Outbound connections from the Codex process to previously unseen hosts shortly after configuration changes, consistent with an attacker-controlled MCP server.

C — Mitigation & Remediation

  1. Immediate (0–24h): Inventory all systems running Codex CLI or Desktop. Upgrade Codex CLI to 0.131.0 or later and Desktop applications to the fixed versions (macOS 26.519.22136 or later; Windows 26.519.21041 or equivalent Microsoft Store package). Restrict or temporarily disable Codex on systems that cannot be patched within hours. Advise developers not to open untrusted repositories until upgrades are complete.
  2. Short-term (1–7d): Verify that upgrades have been applied across the estate. Review Codex configuration files and MCP server definitions for unauthorized changes. Enable or tighten filesystem sandboxing where available. Scan developer workstations for indicators of compromise related to unexpected configuration modifications or anomalous process launches.
  3. Long-term (ongoing): Incorporate Codex version checks into software inventory and vulnerability management processes. Prefer official package channels and automatic update mechanisms where feasible. Maintain policy that untrusted or third-party repositories are opened only in isolated environments. Continuously monitor for new advisories affecting AI coding assistants. For environments that cannot immediately patch, consider removing PowerShell Core if it is not required, or further restricting write access to Codex configuration directories.

D — Best Practices

  • Keep AI coding assistants and related developer tools on supported, fully patched versions and include them in regular vulnerability scanning.
  • Treat any repository originating outside the organization as untrusted until reviewed; open such repositories in isolated or non-privileged environments when possible.
  • Limit the privileges of accounts that run Codex and restrict write access to its configuration and MCP-related directories.
  • Monitor for unexpected modifications to local tool configuration files and for the appearance of new or altered MCP server definitions.
  • Enforce least-privilege principles and application control policies on developer workstations so that even a successful approval bypass has limited impact.

Leave Comment

Want to strengthen your security posture?

Want to strengthen your organization’s security? Explore our blog insights and contact our team for expert guidance tailored to your needs.