Plugin4Shell is a zero-click, high-severity remote code execution vulnerability that lets attackers replace a trusted plugin with malicious code and have it automatically installed by popular coding agents. It affects Claude Code, OpenAI Codex, GitHub Copilot, and Gemini CLI and leverages the fact that plugins inherit the agent user's privileges: a malicious plugin runs with the same access to sensitive data and internal systems, giving full enterprise compromise without any user interaction. Attackers can either publish a benign plugin and later switch it to malicious, or take over an existing plugin repository; because agents auto-update installed plugins in the background, a swapped plugin silently replaces the trusted one and triggers execution across all affected agents.
Technically, the flaw is a SHA-pinning bypass in the client: agents check out a pinned SHA but never verify the working tree actually matches that commit. One exploit creates a branch named exactly like the 40-hex SHA (allowed on Bitbucket and many self-hosted servers) so git prefers the ref over the object id; Gemini’s CLI variant abuses FETCH_HEAD resolution similarly. The correct fix is agent-side: after checkout the agent must verify git rev-parse HEAD equals the pinned SHA and abort if not. Anthropic patched Claude Code (2.1.179) and OpenAI patched Codex (0.146.0); Copilot remained unpatched and Gemini CLI is deprecated and unpatched, so users must update or migrate.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.