CVE-2025-61260: OpenAI Codex CLI enables code execution through malicious MCP (Model Context Protocol) configuration files
OpenAI Codex CLI 0.23.0 and earlier run MCP server commands from a cloned repository without asking. A malicious repo can ship a `.env` and `.codex/config.toml` that execute commands the moment a developer runs `codex` in it. The advisory data lists no patched version, though Check Point says OpenAI fixed it in 0.23.0.
Published Apr 14, 2026 · Updated Apr 16, 2026 · Analysis Oct 30, 2026
What an attacker can do
Check Point Research found that a repository .env could set CODEX_HOME=./.codex, pointing Codex at a config folder inside the repo. Codex then read mcp_servers entries from ./.codex/config.toml and started the declared commands at launch. It did not ask for approval, validate the command or arguments, or re-check them after a change. Trust was tied to where the config came from, not what it held, so a harmless entry could later be swapped for a malicious one with no new prompt.
The attacker needs only to get a developer to clone and open the repository, for example through a pull request or a compromised project. Commands run as that developer. That exposes credentials, source code and CI/CD secrets reachable from the machine. Check Point showed it with a harmless file-creation payload and reverse-shell payloads, with no prompts.
Who is affected
npm package @openai/codex at 0.23.0 and earlier, per the advisory data. Check Point states the fix landed in 0.23.0, so the advisory's upper bound and the researcher's fixed version overlap. Check yours:
npm ls -g @openai/codex
codex --versionAny repository containing .env with CODEX_HOME or a .codex/config.toml is a warning sign.
@openai/codex
- Ecosystem
- npm
- Affected
- <= 0.23.0
- Fixed in
- No patched version yet
- Check
npm ls @openai/codex
How to fix it
The advisory data lists no patched version. Check Point reports that OpenAI released the fix in Codex CLI 0.23.0 on August 20, 2025, blocking project-local redirection of CODEX_HOME. To be safe, move to the latest release:
npm install -g @openai/codex@latestUntil then, do not run codex in untrusted repositories.
How to tell if you were hit
Inspect cloned repositories for a .env that sets CODEX_HOME, and for a .codex/config.toml with mcp_servers entries, especially ones whose command is a shell, curl, or an interpreter. Look at the shell history and process list for child processes started by codex right at launch, and for unexpected outbound connections. Beam records agent shell commands and MCP tool calls for Codex when its hook is installed, and its rules can flag risky ones.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
A vulnerability was identified in OpenAI Codex CLI v0.23.0 and before that enables code execution through malicious MCP (Model Context Protocol) configuration files. The attack is triggered when a user runs the codex command inside a malicious or compromised repository. Codex automatically loads project-local .env and .codex/config.toml files without requiring user confirmation, allowing attackers to embed arbitrary commands that execute immediately.
Questions
- Is Codex CLI 0.23.0 affected by CVE-2025-61260?
The advisory data lists 0.23.0 as vulnerable. Check Point says 0.23.0 contains the fix. Use the latest release to avoid the ambiguity.
- What triggers the attack?
Running
codexinside a repository whose.envsetsCODEX_HOMEto a folder in the repo, containing a maliciousconfig.toml.- Is it exploited in the wild?
Check Point's page shows demonstrations only and does not report exploitation in the wild.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
