Plugin4Shell – Zero Click RCE Vulnerability found in top four coding agents
The coding agents checked out a pinned plugin commit but never verified that the checked-out code matched the pin, so an attacker controlling the plugin repository could make a branch named like the pinned hash resolve to malicious code. Because agents auto-update plugins, this led to zero-click remote code execution on the host.
air.security
Published on air.security
Plugin4Shell is a zero-click, high-severity RCE affecting all four major AI coding agents - Claude Code, Codex, Copilot, and Gemini. In this first-of-its-kind AI supply-chain attack, a trusted plugin is silently swapped for a malicious one and auto-installed past the agent's SHA pinning - a flaw no marketplace can…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The agents resolved the pinned commit to a git ref (branch) of the same name and never verified that the resulting working tree matched the pinned SHA.
Impact
An attacker could achieve zero-click remote code execution and full compromise of the agent and its host, though the branch-name variant is blocked on hosts such as GitHub that reject hash-shaped branch names, and Gemini CLI will not be patched.
What the attacker needed
Attacker controls the plugin repository; plugin already installed by the victim; plugin auto-update enabled (default); git host allows hash-shaped branch names
The fix
Agents should verify after checkout that the resolved HEAD equals the pinned SHA and abort otherwise; Claude Code, Codex and GitHub Copilot were patched, while Gemini CLI was deprecated without a fix.
How it was found
- Publish a benign plugin to a trusted marketplace, pinned at a reviewed commit.
- Users install it, and each install is pinned to that reviewed commit.
- Ship a routine benign update so the marketplace re-pins to a new commit.
- Create a branch named exactly like the new pinned commit, set it as the repository default, and point it at malicious code.
- The changed pin triggers background auto-update; the checkout resolves the pin to the branch and runs the malicious code.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A plugin marketplace pins a plugin to a specific version (a commit) so that only reviewed code runs. The agents downloaded that version but did not confirm that the code they actually ran was the pinned one. An attacker who owned the plugin's repository could create a branch with the same name as the pinned version, and git would run the branch instead, letting the attacker run their own code on the user's machine without any click.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.