Plugin4Shell: a git branch trick beat SHA-pinning on Claude Code, Codex, Copilot and Gemini CLI
Air Security: agents pin a commit, never check what landed. Anthropic and OpenAI patched. Microsoft has not. Google will not fix Gemini CLI. Jessica Lyons at The Register had it Thursday; TNW on Monday.
Deep dive3 minIn-depth
James Okonkwo3 min read
- Claude Code
- Codex
- Copilot
- Gemini CLI
- Supply chain

Photo: The Next Web / Fotis Fotopoulos / UnsplashSource page
Researchers at Air Security say a design error in four AI coding agents lets someone who controls a plugin repository swap reviewed code for something else, without a click. They call it Plugin4Shell. Jessica Lyons reported it for The Register on Thursday. The Next Web filed the Monday reconstruction. The agents are Anthropic’s Claude Code, OpenAI’s Codex, GitHub Copilot and Google’s Gemini CLI. Or Nevo, Dor Granat and Niv Hoffman describe it as zero-click remote code execution: the victim does not install anything new. Claude Code and Codex refresh plugins in the background by default. A plugin the developer already trusts is what gets replaced.
Anthropic fixed it in Claude Code 2.1.179 and confirmed the patch around 17 June, Air told both outlets. OpenAI’s Codex 0.146.0 was verified around 12 August. Microsoft has shipped no Copilot fix as of the reporting. Google told Air it will not patch Gemini CLI, which it is retiring, and pointed users at Antigravity. The Register quoted a GitHub spokesperson: GitHub rejects branch and tag names that look like commit hashes, so the hash-shaped branch trick fails there. Air’s reply is that marketplaces can live on Bitbucket or a company’s own git host, both of which still allow those names, and that Copilot supports those hosts. Microsoft did not respond to The Register. As of 18 September, The Hacker News found no CVE and no public vendor advisory. Anthropic’s 2.1.179 notes do not mention the fix. Air’s post is the public account that it exists.
The agent checks out the exact commit the marketplace pinned but never verifies it landed there, so an attacker who controls the plugin’s repo makes the checkout resolve to malicious code while the pin still looks honored.
— Or Nevo, Dor Granat and Niv Hoffman, Air Security, as quoted by The Register, Sep 17, 2026
A pin that never looks at the working tree
Marketplaces lock each plugin to a 40-character commit hash — one reviewed snapshot. The agents ask git for that snapshot and do not check what actually sits on disk, The Next Web wrote. Git will let a branch carry almost any name, including a string that looks like a hash. When the same name is a valid branch and a valid object, git prefers the branch. Whoever controls the plugin repo can create a branch named after the pin, point it at different code, and make it the default. The agent checks out the branch, installs the attacker’s tree, and reports a clean install at the pinned commit. The Gemini CLI fails a different way: it fetches the right commit, then a checkout that a default branch named FETCH_HEAD can capture, so the correct code never reaches disk. The Next Web’s one-line fix is the obvious one: after checkout, resolve what is in the working tree and abort unless it matches the pin.
The practical blast radius is narrower than four logos. Swati Khandelwal at The Hacker News checked the default catalogues on 18 September and found that every plugin in Anthropic’s community list, and in the default lists for Claude Code and Copilot, pointed at a GitHub repository. Background auto-update, the part that makes the swap zero-click, runs by default only against those built-in marketplaces. A developer who never adds an outside host may never meet the hash-shaped branch. That reasoning does not cover Gemini CLI: FETCH_HEAD is not clearly blocked by GitHub’s hash rule, and Google is not shipping a patch. A plugin runs with the developer’s access. Swapped code reaches files, stored credentials, and whatever the machine can log into. OWASP this month moved “excessive agency” to third in its 2026 top ten, The Next Web noted.
The third time on this seam
Air built a working demonstration in May and disclosed to all four vendors in June. Four months later there is still no CVE. The Next Web set that silence next to the EU Cyber Resilience Act’s 24-hour clock for actively exploited flaws. There is no public sign the bug has been used in a real attack. Air has been on this layer before: a malicious skill that reached about 26,000 agents, then 925 hijacked skills affecting about 134,000. SHA-pinning was the industry answer. Five labs agreed a common plugin standard in August. Plugin4Shell is the pin failing underneath. “The fix has to ship in the agent, and updating is the only complete mitigation where one exists,” Nevo, Granat and Hoffman told The Register. What the published write-ups do not settle is whether updating an agent removes a plugin that was already swapped, or only stops the next one. Gemini CLI stays as it is. Google’s answer is to leave it.


