Skip to the content
AI and Cybersecurity Learning and Practice Center Test automation Open the Learning Center

IncidentCoding assistants

Plugin4Shell: zero-click takeover of four coding agents through plugin pinning

CriticalAnthropicOpenAIGitHubGoogle

AIR found that Claude Code, Codex, GitHub Copilot and Gemini CLI checked out a pinned plugin commit without verifying they had landed on it, so a trusted plugin could be swapped for a malicious one and auto-installed with no user action. Anthropic (Claude Code 2.1.179) and OpenAI (Codex 0.146.0) patched; at disclosure Copilot was unpatched and Gemini CLI was deprecated.

Replay the attack step by step in the Learning Center

How it happened

  1. The agent pinned a plugin to a commit but did not check that the checkout actually landed on that commit.
  2. An attacker who controlled or compromised the plugin repository could serve different code under the same pin.
  3. The agent installed and ran it automatically, with the user's permissions.

Impact

Users who had done everything right, pinning plugins to exact commits, could still be running attacker code.

The fix

Update Claude Code to 2.1.179 or later and Codex to 0.146.0 or later; review installed plugins on Copilot until a fix ships.

Lessons

  • A pin is only a promise if the installer verifies it.
  • Agent plugins are a supply chain: inventory them and re-check them when advisories land.

Sources