ZeroHour
GBHackerspublished ()ingested Divya
Part of a story covered by 9 sources: “Plugin4Shell zero-click RCE hits AI coding agents; Claude-built exploit chain reached OpenAI internal repos” — merged summary and timeline →

Plugin4Shell Zero-Click RCE Hits Claude Code, Codex, Copilot and Gemini CLI

highVulnerabilityimportance 75
AI summary · glm-5.3-flash

Plugin4Shell flaw lets attackers swap SHA-pinned plugins for malicious code, enabling zero-click RCE in Claude Code, Codex, Copilot, and Gemini CLI.

Researchers Or Nevo, Dor Granat, and Niv Hoffman found that Claude Code, OpenAI Codex, GitHub Copilot, and Gemini CLI fetch a pinned commit SHA but fail to verify the checked-out working tree, letting an attacker-created branch with the same 40-character hex name (or FETCH_HEAD for Gemini CLI) resolve to attacker-controlled code. Because coding agents auto-update installed plugins, the malicious swap can deploy without user interaction and execute with developer-level access to source code, secrets, and cloud environments. Anthropic patched Claude Code in 2.1.179 and OpenAI fixed Codex in 0.146.0; Microsoft had not patched GitHub Copilot at disclosure, and Google will not patch the deprecated Gemini CLI.

  • Agents fetch pinned SHAs but never verify the checked-out tree, enabling Git branch-name ambiguity attacks.
  • Claude Code patched in 2.1.179 and Codex in 0.146.0; GitHub Copilot unpatched at disclosure.
  • Google will not patch deprecated Gemini CLI and advises users to migrate away.
  • Plugins run with developer permissions, exposing source code, secrets, and cloud environments.
  • Mitigation is an endpoint-side check that git rev-parse HEAD equals the pinned SHA.
Full article614 words · extracted from gbhackers.com · click to collapse

A newly disclosed vulnerability known as Plugin4Shell reveals a supply chain weakness in major AI coding agents. This flaw allows attackers to replace trusted, SHA-pinned plugins with malicious code, enabling remote code execution without user interaction.

Researchers Or Nevo, Dor Granat, and Niv Hoffman have identified that the issue impacts Anthropic Claude Code, OpenAI Codex, GitHub Copilot, and Gemini CLI.

The vulnerability undermines a critical security measure used by plugin marketplaces and enterprise security teams: pinning an add-on to a specific Git commit that has been reviewed and approved.

Plugin4Shell Zero-Click RCE

AI agent plugins, skills, and extensions often run with the permissions of the developer operating the agent. This may include access to source code, secrets, cloud environments, production systems, internal services, and sensitive enterprise data.

In a standard secure workflow, a marketplace or organization reviews a plugin at a specific Git commit and records that commit’s SHA hash. The agent should then retrieve the exact reviewed code.

However, Plugin4Shell breaks this assumption. Affected agents request the pinned SHA during Git checkout but fail to verify that the checked-out working tree corresponds to that SHA. This creates an opportunity for Git reference name ambiguity.

For Claude Code, Codex, and GitHub Copilot, an attacker can create a branch with the same 40-character hexadecimal name as a pinned commit.

If that branch is set as the default branch of the repository, Git may resolve the branch name instead of the intended commit hash. As a result, the agent could install attacker-controlled code while appearing to have successfully installed the code linked to the trusted pin.

Gemini CLI reportedly has a similar issue. Its installation process fetches a pinned commit but then checks out FETCH_HEAD. If an attacker creates a default branch named FETCH_HEAD, Git can resolve that branch instead of the fetched commit.

The attack is classified as zero-click because several coding agents automatically update previously installed plugins. An attacker could publish a seemingly benign plugin, get marketplace approval, and wait for adoption.

Once a routine marketplace update modifies the pinned version, the attacker could alter the upstream repository so that the new pin resolves to a malicious branch. Background plugin updates could then deploy the malicious code to affected systems without requiring installation prompts, user clicks, or any other warnings.

Researchers also noted that attackers could hijack an existing maintainer’s repository, turning a legitimate, widely used plugin into a delivery vehicle for attacks. This suggests that organizations that review plugin code and depend on commit pinning may still be vulnerable if their agent does not validate the final checked-out commit.

Patches and Mitigation

The fundamental solution is straightforward: agents must verify the commit that is actually checked out after installation with the following check:

test "$(git rev-parse HEAD)" = "<pinned-sha>" || abort

This verification must occur on the endpoint, within the agent itself, because marketplaces cannot reliably enforce how a local Git client resolves a pin.

As of this writing, Anthropic has patched Claude Code in version 2.1.179, and OpenAI has addressed the vulnerability in Codex 0.146.0. Microsoft had not yet released a fix for GitHub Copilot at the time of disclosure, and Google reportedly will not patch the deprecated Gemini CLI, advising users to migrate away from it.

Organizations should promptly update supported coding agents, inventory installed plugins, restrict access to unvetted Git hosting sources, and review repository ownership and default branch settings for existing agent extensions.

Cut every SOC alert investigation by 21 min. Power your SOC with instant IOC context for immediate response: Integrate TI Lookup in your SOC

Divya

Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Text extracted automatically; images, tables and formatting may be missing. Original: https://gbhackers.com/plugin4shell-zero-click-rce/