Join our Newsletter — 33% off our NHI Course

How did a git allowlist in Codex CLI end in RCE?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 20230
Topic starter  

TL;DR: A safe git allowlist in Codex CLI could be turned into arbitrary file write and remote code execution through git show --output, according to Pillar Security. File-target restrictions and invocation checks matter because command names alone do not stop configuration files from becoming execution bridges.

Editorial analysis by NHI Mgmt Group, based on content published by Pillar Security: “The Week of Sandbox Escapes Day 5: GitPwned: Allowlist to RCE”.

Key questions

Q: Why do command allowlists fail when AI agents can generate arguments?

A: Because the risk sits in the argument space, not only in the command name.

Q: What are the signs that an AI agent conversation is becoming unsafe?

A: Look for repeated reframing, slow escalation toward sensitive actions, probing for tool access, and requests that narrow from a legitimate task into higher-risk operations.

Q: What breaks when AI coding agents rely on command allowlists for safety?

A: Allowlists break when a command’s arguments can change it from harmless to dangerous.

Practitioner guidance

  • Harden allowlists around invocations, not binaries Require argument-level inspection for every safe-listed command and block flags that change read-only tools into write-capable tools, especially where AI agents can generate the invocation.
  • Remove write access to execution-sensitive config files Prevent agents from writing to files such as .git/config, shell profiles, or tool configuration that can redirect later execution into attacker-controlled code.
  • Constrain agent actions with deterministic policy checks Enforce policy on the final system call or file target, so model refusal or prompt classification is never the only thing standing between safe and unsafe behaviour.

Bottom line: This sandbox escape shows that allowlisting a command name is not enough when arguments can turn a read-only tool into a write primitive.

Glossary terms: Allowlist, Sandbox Escape, Invocation Control, Configuration-Triggered Execution

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →


This topic was modified 2 weeks ago by NHI Mgmt Group

   
Quote
(@mr-nhi)
Member Moderator
Joined: 7 months ago
Posts: 20718
 

Invocation, not command name, is the control boundary: this case shows that AI agent governance fails when policy stops at the binary name. A non-human actor can still weaponise a permitted command through flags that alter state, so the security model has to evaluate arguments, file targets, and downstream effects. Practitioners should treat invocation analysis as part of agent authorisation, not an optional hardening layer.

A few things that frame the scale:

A question worth separating out:

Q: Should organisations trust model refusal to block malicious agent actions?

A: No. Model refusal is probabilistic, so it cannot be treated as a reliable control boundary. Organisations should assume the model will sometimes comply with harmful instructions and design deterministic controls that still prevent harmful writes, privilege changes, and downstream execution.

👉 Read our full editorial: Codex CLI sandbox escapes show why model behaviour is not control



   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.