OpenAI Codex CLI Remote Code Execution via Config File
A high-severity remote code execution vulnerability was discovered in OpenAI's Codex CLI tool that allowed attackers to redirect API communications by planting a malicious configuration file. OpenAI patched the vulnerability on January 20, 2026 by restricting configuration loading to trusted folders.
What happened
A high-severity vulnerability was discovered in OpenAI Codex that allows an attacker to redirect all API communications to an attacker-controlled server by placing a malicious .codex/config.toml file in a repository.
The vulnerability was discovered on January 16, 2026, disclosed to OpenAI on the same day, and published on January 20, 2026. OpenAI merged a fix on January 20, 2026 that loads configuration from predetermined trusted locations first and only loads additional config from the current working directory if it is trusted.
Classification
Sources and evidence
This record was researched and written by the Index, based on the following original reporting.