Plugin4Shell a zero‑click remote code execution (RCE) supply‑chain vulnerability!
Plugin4Shell is a SHA‑pinning bypass: AI coding agents fetch a plugin using a pinned commit hash but never verify that the checked‑out code actually matches that hash. This allows attackers controlling a plugin repository to:
Create a branch named exactly like the commit hash (allowed on Bitbucket and self‑hosted Git servers).
Point that branch to malicious code.
The agent installs the malicious branch while reporting the correct pinned version.
This is why Plugin4Shell is considered the first true supply‑chain vulnerability in the AI agent ecosystem.
Many agents (Claude Code, Codex) perform background auto‑updates. When a marketplace bumps the pinned SHA:
The agent re‑runs the checkout automatically.
The malicious swap happens without any user action.
Even users who installed a plugin months ago can be compromised silently.
Who is affected
AI Coding Agent | Status | Notes |
|---|---|---|
Claude Code | Patched | Fixed in version 2.1.179. |
OpenAI Codex | Patched | Fixed in version 0.146.0. |
GitHub Copilot | Unpatched | Still vulnerable; relies on GitHub’s branch‑name restrictions for partial protection. |
Google Gemini CLI | Will not be patched | Google is deprecating the CLI entirely. |
Attackers can compromise users in two main ways:
Publish a benign plugin, wait for adoption, then flip the branch to malicious code.
Take over an existing trusted plugin repository and swap the code using the SHA‑named branch trick.
Because plugins run with the same privileges as the developer, malicious code can access:
Local files
Saved credentials
Connected systems
Enterprise repositories and CI/CD environments
Why this vulnerability is so dangerous
It compromises supply‑chain integrity, not just the agent itself.
It affects developers who did everything right — reviewed plugins, pinned versions, used trusted marketplaces.
It can lead to enterprise‑wide compromise, including lateral movement across repositories and systems.
How to protect yourself
Update Claude Code and Codex immediately to patched versions.
Audit all installed plugins, especially those sourced from Bitbucket or self‑hosted Git servers.
Disable auto‑update for plugins until your environment is verified safe.
Prefer GitHub‑hosted plugins, which block hash‑shaped branch names.
Monitor plugin repositories for unexpected branch changes or ownership transfers.

Comments
Post a Comment