CTIPilot

OpenAI Codex CLI

product · product:openai-codex-cli single-source

Coverage timeline
2
first 2026-07-11 → last 2026-08-10
Peak priority
notable
2 notable
Sources cited
4
3 hosts
Sections touched
1
research
Co-occurring entities
5
see Co-occurring entities below
ATT&CK techniques
4
pinned v19.2 · see below

Hunting pivots

Releases covered
OpenAI Codex CLI ×2

ATT&CK techniques

4 techniques observed across 2 entries, derived from entry metadata and body evidence, never asserted without a published entry behind it · pinned to MITRE ATT&CK v19.2 · compare on the matrix · Navigator layer (JSON)

Initial Access TA0001

T1195.001Supply Chain Compromise: Compromise Software Dependencies and Development Tools×1

Adversaries may manipulate software dependencies and development tools prior to receipt by a final consumer for the purpose of data or system compromise. Applications often depend on external software to function properly. Popular open source projects that are used as dependencies in many applications, such as pip and NPM packages, may be targeted as a means to add malicious code to users of the dependency. This may also include abandoned packages, which in some cases could be re-registered by threat actors after being removed by adversaries. Adversaries may also employ "typosquatting" or name-confusion by choosing names similar to existing popular libraries or packages in order to deceive a user.

Evidence: 2026-07-11/friendly-fire-prompt-injection-rce-defensive-ai-agents · ATT&CK page ↗

Execution TA0002

T1059.004Command and Scripting Interpreter: Unix Shell×1

Adversaries may abuse Unix shell commands and scripts for execution. Unix shells are the primary command prompt on Linux, macOS, and ESXi systems, though many variations of the Unix shell exist (e.g. sh, ash, bash, zsh, etc.) depending on the specific OS or distribution. Unix shells can control every aspect of a system, with certain commands requiring elevated privileges.

Evidence: 2026-07-11/friendly-fire-prompt-injection-rce-defensive-ai-agents · ATT&CK page ↗

T1204.002User Execution: Malicious File×1

An adversary may rely upon a user opening a malicious file in order to gain execution. Users may be subjected to social engineering to get them to open a file that will lead to code execution. This user action will typically be observed as follow-on behavior from Spearphishing Attachment. Adversaries may use several types of files that require a user to execute them, including .doc, .pdf, .xls, .rtf, .scr, .exe, .lnk, .pif, .cpl, .reg, and .iso.

Evidence: 2026-07-11/friendly-fire-prompt-injection-rce-defensive-ai-agents · ATT&CK page ↗

Credential Access TA0006

T1552.001Unsecured Credentials: Credentials In Files×1

Adversaries may search local file systems and remote file shares for files containing insecurely stored credentials. These can be files created by users to store their own credentials, shared credential stores for a group of individuals, configuration files containing passwords for a system or service, or source code/binary files containing embedded passwords.

Evidence: 2026-08-10/coding-agent-forensic-artefacts-opencode-codex-credentials · ATT&CK page ↗

Story timeline

  1. 2026-08-10CERT Intrinsec maps where autonomous coding agents leave evidence on disk; the same session databases and token files an investigator needs are a credential-collection target
    researchOpenCode and OpenAI Codex write prompt history, per-session logs and plaintext API keys to predictable per-user paths
  2. 2026-07-11'Friendly Fire': prompt injection hijacks AI coding agents' defensive auto-review into remote code execution
    researchAI Now Institute PoC turns an untrusted library's own files into RCE when Claude Code or Codex CLI review it in auto-mode, no hooks or config needed

Where this entity is cited

  • research2

Source distribution

  • intrinsec.com2 (50%)
  • ainowinstitute.org1 (25%)
  • infosecurity-magazine.com1 (25%)

Co-occurring entities

Derived: referenced by the same focused operational entries (weekly summaries and report roundups don't count); ×N counts the shared entries.

Entries about OpenAI Codex CLI (2)

2026-08-10 · view entry permalink →

NOTABLENATOB2

CERT Intrinsec maps where autonomous coding agents leave evidence on disk; the same session databases and token files an investigator needs are a credential-collection target

Autonomous coding agents now run shells, install helpers and reach networks on developer and build endpoints, and this pipeline has already covered a case of one standing up a reverse tunnel and installing persistence on a real macOS developer machine. CERT Intrinsec's contribution is the responder-side counterpart: where these tools actually leave evidence (CERT Intrinsec, 2026-07-27, CERT Intrinsec, 2026-07-31).

For OpenCode, an open-source agent shipped as a CLI, desktop application and IDE extension, configuration lives in a per-user opencode directory whose opencode.json records how the agent was set up. The artefact that matters most is a SQLite database, Intrinsec calls opencode.db "the most valuable artifact", "a SQLite database storing sessions, messages, projects, workspaces, etc." Its message table distinguishes model responses from user prompts by whether a timing field is present alongside the text, so an investigator can reconstruct both halves of a conversation and bound each response in time. A separate file in the same tree holds authentication material: "This file contains authentication information such as API keys."

For OpenAI's Codex CLI the shape is the same with different names. Everything sits under a per-user .codex directory; auth.json carries authentication information including API keys and access tokens; history.jsonl carries the list of user prompts; and per-session rollout logs record the session itself, including token-usage events that report input, cached-input, output and reasoning-token counts for the session and for the most recent response, plus the model's context window. That last detail is more useful than it first appears, it lets a responder estimate how much material an agent session actually processed without having to reconstruct the content.

The dual reading is the point. For incident response this is a map of where to look when a coding agent is implicated in an intrusion, and the prompt history is unusually valuable evidence because it records operator intent directly rather than by inference. For threat modelling it is an inventory: an attacker who reaches a developer workstation or a CI runner with any code execution finds provider credentials in cleartext JSON at a predictable per-user path, together with a transcript of what the organisation has been building. Neither file requires privilege escalation to read if the attacker already has the user's context.

The most valuable artifact is the opencode.db which is a SQLite database storing sessions, messages, projects, workspaces, etc.

This file contains authentication information such as API keys.

CERT Intrinsec 2026-07-27
research10 Aug 04:48Zsingle-sourceOpen finding ↗

2026-07-11 · view entry permalink →

NOTABLENATOB2

'Friendly Fire': prompt injection hijacks AI coding agents' defensive auto-review into remote code execution

AI Now Institute researchers Boyan Milanov and Heidy Khlaaf published a proof-of-concept, "Friendly Fire," that achieves remote code execution against Anthropic's Claude Code CLI (auto-mode, with Sonnet 4.6, Sonnet 5 or Opus 4.8) and OpenAI's Codex CLI (auto-review, with GPT-5.5) when either is used for its advertised defensive purpose, reviewing the security of an untrusted open-source or third-party library (AI Now Institute, 2026-07-08). The attack needs only an out-of-the-box configuration: no custom hooks, skills, plugins, MCP servers, or machine-configuration files as an injection vector. The chain is two layers of prompt injection carried entirely inside the reviewed repository's own files. The first layer makes a malicious binary look safe: alongside the binary (code_policies) the attacker ships a decoy Go source file (code_policies.go) implementing a legitimate-looking static checker, and embeds matching string constants in the binary so the agent's own disassembly-inspection step associates the two and clears it. The second layer, placed in README.md (deliberately, because README is not an enforceable machine-config file and needs no user approval) references a bundled security.sh "security checker" in innocuous language, leading the agent to run the script, which launches the binary (AI Now Institute, 2026-07-08; Infosecurity Magazine, 2026-07-10).

The researchers demonstrated the technique against a modified copy of the geopy Python library and report it transfers to other libraries and to Codex without modification, mapping it onto two realistic threat models: malicious library maintainers embedding instructions in their own code, and supply-chain compromise of upstream packages (they cite recent GitHub-repo-poisoning and PyTorch Lightning incidents), the latter especially dangerous where CI/CD auto-updates dependencies and then hands them to a defensive agent to review. They explicitly reject sandboxing as a sufficient mitigation, arguing an in-sandbox RCE can be used to attempt escape and citing sandbox-escape CVEs against Claude Code itself.

Our attack only requires an out-of-the-box configuration of Claude Code in “auto-mode” or Codex in “auto-review” and leverages prompt injections disseminated across a library’s source code that target AI-enabled cyber defense without the need for hooks, skills, plugins, MCP servers, or configuration files as an injection vector.

When Claude Code or Codex proceed to analyze the source code, the prompt injections steer each respective agent to presume that the malicious binary is necessary to perform the security review, thereby executing the binary and failing to detect it as harmful.

AI Now Institute 2026-07-08

Builds on: 2026-06-29/mozilla-0din-a-clean-github-repo-coerces-ai-coding-agents-in · 2026-07-09/ghostapproval-ai-coding-assistant-symlink-trust-boundary

research11 Jul 04:30Zmulti-sourceOpen finding ↗