<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/a-single-git-trick-beat-the-safety-lock-on-four-ai-coding-agents-sjof9z2f1" -->

---
title: A single git trick beat the safety lock on four AI...
description: Researchers at Air Security disclosed Plugin4Shell, a zero-click remote code execution flaw in Claude Code, Codex, GitHub Copilot, and Gemini CLI. Plugin...
canonical: https://daily.dev/posts/a-single-git-trick-beat-the-safety-lock-on-four-ai-coding-agents-sjof9z2f1
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: A single git trick beat the safety lock on four AI coding agents | daily.dev
og:description: Researchers at Air Security disclosed Plugin4Shell, a zero-click remote code execution flaw in Claude Code, Codex, GitHub Copilot, and Gemini CLI. Plugin...
og:url: https://daily.dev/posts/a-single-git-trick-beat-the-safety-lock-on-four-ai-coding-agents-sjof9z2f1
og:image: https://api.daily.dev/og/posts/sJOF9Z2f1.png
og:image:alt: A single git trick beat the safety lock on four AI coding agents
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# A single git trick beat the safety lock on four AI coding agents

**[The Next Web](https://daily.dev/sources/tnw)** · 6 min read · 0 upvotes · 0 comments

## Summary

Researchers at Air Security disclosed Plugin4Shell, a zero-click remote code execution flaw in Claude Code, Codex, GitHub Copilot, and Gemini CLI. Plugin marketplaces pin add-ons to a commit hash for safety, but git prefers a branch name over an identical-looking commit hash, letting a repo owner create a branch named after the pinned hash and swap in malicious code that auto-updating agents silently install. Anthropic patched in Claude Code 2.1.179 and OpenAI in Codex 0.146.0; Microsoft has not patched Copilot, and Google will not fix Gemini CLI since it's being retired in favor of Antigravity. GitHub disputes real-world exposure since it blocks hash-shaped branch names, but Air says Bitbucket and self-hosted git servers remain vulnerable. No CVE or advisory has been published four months after disclosure.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://thenextweb.com/news/plugin4shell-ai-coding-agents-zero-click-rce-sha-pinning>

## Questions this post answers

### What is the Plugin4Shell vulnerability in Claude Code, Codex, Copilot, and Gemini CLI?

Plugin4Shell is a zero-click remote code execution flaw where git prefers a branch name over an identical-looking commit hash, letting a repository owner create a branch named after a plugin's pinned commit hash and point it at malicious code. Affected agents check out the branch, install the attacker's code, but still report a clean install at the pinned commit. Discovered by Air Security, disclosed to vendors in June.

_Track how AI coding agent vendors patch supply-chain flaws like this one on daily.dev._

### Has Anthropic Claude Code fixed the Plugin4Shell git branch hijacking bug?

Yes, Anthropic fixed it in Claude Code version 2.1.179, confirmed on 17 June. OpenAI fixed the same flaw in Codex 0.146.0, verified fixed on 12 August. Microsoft has shipped no fix for GitHub Copilot, and Google will not fix Gemini CLI at all because it is retiring that product in favor of Antigravity.

_Developers pinning agent versions can follow patch status for tools like these on daily.dev._

### Is GitHub Copilot vulnerable to the Plugin4Shell attack if plugins are hosted on GitHub?

No, GitHub rejects branch names shaped like commit hashes, so the branch-swap trick fails for marketplaces hosted directly on GitHub. Air Security disputes that this fully protects users, since Copilot also supports Bitbucket and self-hosted git servers as marketplace backends, both of which allow hash-shaped branch names and remain exploitable.

_Anyone weighing plugin marketplace hosting risk can keep up with disclosures like this on daily.dev._

## Similar posts on daily.dev

- [The Plugin Was Trusted. The Code Wasn’t.](https://daily.dev/posts/the-plugin-was-trusted-the-code-wasn-t--ob4senb1p) · Medium · 0 upvotes · 0 comments

---

Tags: [#cyber](https://daily.dev/tags/cyber), [#github](https://daily.dev/tags/github), [#git](https://daily.dev/tags/git), [#claude-code](https://daily.dev/tags/claude-code)

[View this post on daily.dev](https://daily.dev/posts/a-single-git-trick-beat-the-safety-lock-on-four-ai-coding-agents-sjof9z2f1)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"A single git trick beat the safety lock on four AI coding agents","url":"https://daily.dev/posts/a-single-git-trick-beat-the-safety-lock-on-four-ai-coding-agents-sjof9z2f1","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/a-single-git-trick-beat-the-safety-lock-on-four-ai-coding-agents-sjof9z2f1"},"datePublished":"2026-09-21T12:59:48.006Z","dateModified":"2026-09-21T13:00:43.970Z","description":"Researchers at Air Security disclosed Plugin4Shell, a zero-click remote code execution flaw in Claude Code, Codex, GitHub Copilot, and Gemini CLI. Plugin...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5d69ceead5f792d5e3b32d70a4679fea?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5d69ceead5f792d5e3b32d70a4679fea?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"The Next Web","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"The Next Web","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/tnw","url":"https://daily.dev/sources/tnw"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/a-single-git-trick-beat-the-safety-lock-on-four-ai-coding-agents-sjof9z2f1","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"cyber,github,git,claude-code","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"The Next Web","item":"https://daily.dev/sources/tnw"},{"@type":"ListItem","position":3,"name":"A single git trick beat the safety lock on four AI coding agents"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/a-single-git-trick-beat-the-safety-lock-on-four-ai-coding-agents-sjof9z2f1#faq","mainEntity":[{"@type":"Question","name":"What is the Plugin4Shell vulnerability in Claude Code, Codex, Copilot, and Gemini CLI?","acceptedAnswer":{"@type":"Answer","text":"Plugin4Shell is a zero-click remote code execution flaw where git prefers a branch name over an identical-looking commit hash, letting a repository owner create a branch named after a plugin's pinned commit hash and point it at malicious code. Affected agents check out the branch, install the attacker's code, but still report a clean install at the pinned commit. Discovered by Air Security, disclosed to vendors in June. Track how AI coding agent vendors patch supply-chain flaws like this one on daily.dev."}},{"@type":"Question","name":"Has Anthropic Claude Code fixed the Plugin4Shell git branch hijacking bug?","acceptedAnswer":{"@type":"Answer","text":"Yes, Anthropic fixed it in Claude Code version 2.1.179, confirmed on 17 June. OpenAI fixed the same flaw in Codex 0.146.0, verified fixed on 12 August. Microsoft has shipped no fix for GitHub Copilot, and Google will not fix Gemini CLI at all because it is retiring that product in favor of Antigravity. Developers pinning agent versions can follow patch status for tools like these on daily.dev."}},{"@type":"Question","name":"Is GitHub Copilot vulnerable to the Plugin4Shell attack if plugins are hosted on GitHub?","acceptedAnswer":{"@type":"Answer","text":"No, GitHub rejects branch names shaped like commit hashes, so the branch-swap trick fails for marketplaces hosted directly on GitHub. Air Security disputes that this fully protects users, since Copilot also supports Bitbucket and self-hosted git servers as marketplace backends, both of which allow hash-shaped branch names and remain exploitable. Anyone weighing plugin marketplace hosting risk can keep up with disclosures like this on daily.dev."}}]}
```

