Description

Plugin4Shell is a high-severity supply-chain vulnerability affecting major AI coding agents, including Anthropic Claude Code, OpenAI Codex, GitHub Copilot, and Google Gemini CLI. The flaw bypasses plugin security controls based on Git commit SHA pinning, allowing attacker-controlled code to replace a reviewed plugin. Because some agents automatically update installed plugins, exploitation can occur without user interaction. The vulnerability occurs because affected agents request a specific Git commit but fail to verify that the resulting working tree actually corresponds to that commit. For Claude Code, Codex, and Copilot, an attacker controlling a plugin repository can create a branch whose name matches the 40-character hexadecimal SHA and configure it as the default branch. Git may resolve the branch instead of the intended commit, causing malicious code to be checked out while the agent still appears to have honored the pin. Gemini CLI has a related issue involving FETCH_HEAD, where the installation process fetches the pinned commit but subsequently checks out FETCH_HEAD without validating the resulting HEAD. This enables a similarly controlled repository branch to replace trusted content. The weakness becomes zero-click when background plugin updates automatically deploy the manipulated code.