Skip to content
BreachModal logoBreachModal
AI Security6 min read·

Plugin4Shell: Zero-Click RCE in AI Agents Explained

BreachModal analysis of Plugin4Shell, a zero-click RCE vulnerability in AI agents. Learn how it bypasses SHA-pinning and impacts Copilot, Claude, and Codex.

Plugin4Shell: Zero-Click RCE in AI Agents Explained

The trust model for the entire AI agent ecosystem is fundamentally flawed, enabling a new class of zero-click supply chain attacks. The discovery of the Plugin4Shell vulnerability proves that the marketplaces and plugin architectures powering modern AI coding assistants are a critical, unmanaged attack surface. This is not a theoretical risk; it is an active failure of security design.

According to research published by Air Security on September 17, 2026, the Plugin4Shell vulnerability is a zero-click remote code execution (RCE) flaw affecting AI coding agents from Anthropic, OpenAI, GitHub, and Google. The flaw resides in how these agents handle plugin installations from Git repositories, specifically by bypassing the SHA-pinning mechanism intended to guarantee code integrity. Affected products include Anthropic's Claude Code (pre-2.1.179), OpenAI's Codex (pre-0.146.0), Google's Gemini CLI (now deprecated), and, according to the initial disclosure, GitHub Copilot.

Note what this means: the very mechanism designed to ensure a developer is running a vetted, secure version of a plugin is the vector of compromise. This is a systemic failure rooted in a misplaced trust in Git's behavior and the rush to build extensible AI platforms without hardening the extension process itself. Why does this keep happening? Because the economic incentive to rapidly ship features like plugin marketplaces outweighs the perceived cost of securing the underlying software supply chain, a miscalculation that places the entire burden of risk squarely on the user.

[Visual Graphic 1]

Anatomy of the Plugin4Shell Exploit

The exploit chain for the Plugin4Shell vulnerability is a case of elegant simplicity, abusing a feature of Git to create a fatal ambiguity. AI agents use SHA-pinning to lock a plugin to a specific version, referencing its unique 40-character commit hash. The agent is supposed to fetch *only* that commit. However, Air Security found that the agents' `git checkout` process could be deceived.

An attacker controlling a plugin's Git repository can create a branch and name it with the exact 40-character string of a legitimate, pinned commit hash. By then setting this malicious branch as the repository's default, they create a reference name ambiguity. When the AI agent attempts to check out the pinned SHA, Git may resolve the reference to the attacker-controlled branch head instead of the intended commit, as detailed in advisories for similar issues like [CVE-2022-24765](https://nvd.nist.gov/vuln/detail/CVE-2022-24765). The agent, failing to verify that the checked-out code *actually* corresponds to the requested SHA, proceeds to install the malicious plugin.

> 🧠 CISO Brief: This is a supply chain integrity attack. Your development teams' AI assistants, trusted tools designed to accelerate work, can become beachheads for intrusion. The vulnerability allows a trusted plugin update process to silently swap in malicious code, bypassing all user interaction and consent. This makes traditional endpoint detection challenging, as the process appears legitimate.

The result is a zero-click RCE. The attack requires no phishing, no user error, no interaction whatsoever. A background plugin update check is all it takes to compromise the system. This is a textbook example of a [compromised software dependency](https://attack.mitre.org/techniques/T1195/001/), a tactic increasingly favored by sophisticated threat actors.

This vulnerability weaponizes the trust inherent in automated dependency management, turning a security feature into the attack vector itself.

Impact: From Developer Laptop to Kingdom Keys

A compromised AI coding agent is not just a compromised developer machine; it is a catastrophic breach of the entire software development lifecycle. These agents have privileged access to an organization's most sensitive intellectual property and infrastructure credentials. The moment Plugin4Shell is exploited, the game is over.

Quantify the blast radius. An attacker gains execution context within the developer's environment, with the privileges of the agent. This immediately provides access to: source code repositories, API keys stored in environment variables, cached cloud provider credentials (AWS, GCP, Azure), and connections to CI/CD pipelines. According to the [2025 IBM Threat Intelligence Index](https://www.ibm.com/reports/threat-intelligence), attacks leveraging stolen credentials are the most common initial access vector. Plugin4Shell automates this credential theft.

> 🧩 Tactical Note: If you were the CISO here, you would see the agent's process (e.g., `node`, `python`) suddenly spawning unusual child processes like `whoami`, `curl`, or `powershell.exe -enc`. The agent would begin accessing files and network locations completely unrelated to its coding tasks, a clear indicator of post-exploitation activity.

From this foothold, lateral movement is trivial. The attacker can inject malicious code into source repositories, poison build artifacts, or pivot into cloud infrastructure using the harvested credentials. The developer's machine becomes Patient Zero in a full-scale supply chain attack, as outlined in [ENISA's supply chain threat landscape report](https://www.enisa.europa.eu/publications/threat-landscape-for-supply-chain-attacks).

[Visual Graphic 2]

One of the more unfortunate ironies is that a tool designed to write code becomes the perfect vehicle for distributing malicious code. It's like the fire department showing up with gasoline.

The potential for damage scales with the agent's integration, making it a high-value target for espionage and sabotage.

Vendor Response and the Patching Gap

The reaction from affected vendors has been a mixed bag of rapid response, strategic withdrawal, and concerning silence. This fractured response highlights the immaturity of the AI agent security ecosystem.

Anthropic and OpenAI acted decisively. Anthropic patched Claude Code in version 2.1.179, and OpenAI addressed the flaw in Codex version 0.146.0. These vendors acknowledged the severity and provided clear remediation paths for their users. This is the standard of care organizations should expect.

Google's response was to deprecate the affected Gemini CLI entirely, stating it will not provide a patch. While this eliminates the vulnerability, it forces users to migrate, a disruptive and costly process. It is a solution that prioritizes Google's liability over its users' operational stability.

Most concerning was the initial status of GitHub Copilot. As of September 21, 2026, days after the public disclosure, it was reported as unpatched. While [GitHub's security team](https://github.blog/2022-04-12-git-security-vulnerability-announced/) later stated its platform has other mitigations, the lack of a specific patch or CVE rebuttal creates dangerous ambiguity. Organizations that fail to provide clear, timely guidance on high-severity vulnerabilities are choosing opacity over user safety.

> ⚠️ BreachModal Insight: The lack of a unified CVE for Plugin4Shell is a failure of the disclosure process. A single vulnerability affecting multiple vendors should have a common identifier to simplify tracking and response. Without it, security teams are left to track four separate issues, increasing the chance that one will be missed.

This incident underscores the need for a standardized security response framework for AI-native tools.

Proof of Concept

This walkthrough demonstrates the Git reference ambiguity that enables the Plugin4Shell vulnerability. It does not execute malicious code but proves how an attacker can force a checkout of a malicious branch when a specific commit hash is requested.

1. Step 1: Create a Benign Repository and Commit

First, we simulate the legitimate plugin repository. We create a file, commit it, and capture its commit hash.

```bash Create and initialize the repository mkdir legitimate-plugin && cd legitimate-plugin git init Create a benign file and commit it echo "version 1.0" > code.js git add . git commit -m "Initial safe commit" Get the commit hash (this is what the AI agent pins) COMMIT_HASH=$(git rev-parse HEAD) echo "Pinned Commit Hash: $COMMIT_HASH" ```

2. Step 2: Create the Malicious Branch

Now, the attacker creates a new branch named *exactly* the same as the legitimate commit hash. This branch contains malicious code.

```bash Create a new branch named after the commit hash git checkout -b $COMMIT_HASH Replace the file with malicious content echo "// RCE payload here" > code.js git add . git commit -m "Malicious code" ```

3. Step 3: Simulate the Attack

The attacker pushes the malicious branch and sets it as the default on a remote repository (e.g., GitHub). A victim's AI agent then attempts to clone and check out the pinned `COMMIT_HASH`.

```bash Victim simulation: clone the repo and try to check out the pinned hash cd .. git clone legitimate-plugin victim-agent cd victim-agent This command is ambiguous and triggers the vulnerability git checkout $COMMIT_HASH ```

4. Step 4: Verify the Compromise

Check the contents of the file. Despite requesting the safe commit hash, the agent has checked out the malicious branch's code.

```bash Verify the content of the checked-out file cat code.js Expected Output: // RCE payload here ```

This confirms the core mechanism of the Plugin4Shell vulnerability: the local Git client resolves the ambiguous reference to the branch name, not the commit hash, leading to code injection.

FINAL VERDICT

The Plugin4Shell vulnerability is a watershed moment for AI security. It unequivocally demonstrates that the software supply chain for AI agents is a fragile, high-risk attack surface that most organizations are unprepared to defend. The risk of compromise is borne not by the AI vendors, but by the enterprises that deploy these agents with unrestricted access to their most critical assets. A fundamental shift is required: organizations must move from a model of implicit trust in AI marketplaces to one of zero-trust, where every plugin is treated as untrusted third-party code until explicitly vetted and verified. The failure to do so is an invitation for catastrophic breach.

Is your organization prepared to audit, control, and respond to threats within your AI development ecosystem? BreachModal's Adversarial Simulation and Digital Defense Strategy services can identify these gaps before they are exploited. [Contact us to secure your AI transformation.](https://breachmodal.com/contact)

Want this expertise working for your team?

Schedule a 30-minute call and we'll walk through your specific security posture.

Book a consultation
← Back to all articles