Pinned Is Not Verified
Plugin4Shell let a plugin owner swap the code behind a commit-pinned plugin in four major coding agents, and background auto-update made it zero-click. A pin is a request. Only a check is a guarantee.
Air Security published Plugin4Shell on September 17, after a coordinated disclosure that started in June. It affects the plugin systems of Claude Code, OpenAI Codex, GitHub Copilot, and Gemini CLI, and it is one of the cleanest illustrations I have seen of a principle that keeps getting relearned: telling a system what you want is not the same as checking what you got.
What happened
Plugin marketplaces for coding agents pin each plugin to a specific commit SHA. The idea is sound. A 40-character hash names one exact snapshot of code, so even if the plugin’s owner later pushes something malicious, you keep getting the version that was reviewed.
The agents checked out the pinned SHA. They did not verify that the checkout actually
landed on it. And git, when asked to check out a name, prefers a ref with that name over
a commit with that hash. So an owner who controls the plugin repository can create a
branch whose name is the pinned hash, put different code on it, and make it the default
branch. The checkout resolves to the branch. Git prints a “refname is ambiguous” warning
that nobody reads. The pin looks honored and is not. Gemini CLI had a variant of the same
problem with a branch named FETCH_HEAD.
GitHub rejects 40-character hex branch names, which narrows the exposure. Bitbucket and self-hosted git servers allow them.
The part that made it zero-click is background auto-update, which is the default in Claude Code and Codex. When a marketplace re-pins a plugin, installed copies re-run the same checkout with no user action.
How the vendors responded
The response record is worth stating because it is instructive in both directions. Claude Code fixed it in version 2.1.179, confirmed in June. Codex fixed it in 0.146.0, verified in August. Copilot’s fix shipped in VS Code 1.136.0 on September 2, and it does exactly the right thing: it checks that the checked-out commit matches the pinned SHA. Google told the researchers in August that it would not patch Gemini CLI because the tool is deprecated, and pointed users to Antigravity, which the researchers say this attack does not reach.
Three fixes, all variations of one line: after checkout, confirm HEAD equals the pin,
and refuse to proceed if it does not.
Every pin needs a postcondition
The general lesson is bigger than git. A pin, a hash, a version constraint, a policy, a “no internet” instruction: all of these are requests to some other piece of software. They become guarantees only when something checks the result. Without the check, you have documentation of your intent and nothing more.
This is the same shape as the sandbox failures from this summer, which I wrote about in The Sandbox Is Production. A prompt said there was no internet. Nobody measured whether that was true. Here, a manifest said which commit to run. Nobody measured whether that was the commit that ran. Different layer, same missing assertion.
For anyone building on agents, the checklist is short and boring, which is the point:
Assert after every fetch. Resolve the ref, compare it to what you asked for, and fail closed. It costs microseconds.
Make auto-update a decision, not a default. Background updates are convenient for features and dangerous for anything that executes. If you keep them, scope which marketplaces and hosts are allowed. Claude Code, for example, has a setting that restricts plugin sources by owner or host pattern. Use it.
Treat plugins as dependencies with shell access. Because that is what they are. An agent plugin runs with the agent’s permissions, inside a tool that can already read your code and run commands. The review bar should be at least what you apply to a new npm package, and probably higher.
The supply chain is the agent
Software supply-chain security spent a decade learning, painfully, that signatures need verification, lockfiles need integrity hashes, and anything fetched at runtime is untrusted until proven otherwise. Agent ecosystems are rebuilding that stack in months, with the added wrinkle that the consumer of the dependency is itself an autonomous process with credentials.
I expect more of this, not less, and here is the falsifiable version: by mid-2027, at least one widely used agent plugin or skill will be compromised in the wild through an update path, not through a malicious initial install. The fix will again be a check that should have been there from the start. The cheapest security control in computing is still the assertion you actually run.