{"id":12272,"date":"2026-04-21T10:04:18","date_gmt":"2026-04-21T10:04:18","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2026\/04\/21\/claude-code-gemini-cli-and-github-copilot-vulnerable-to-prompt-injection-via-github-comments\/"},"modified":"2026-04-21T10:04:18","modified_gmt":"2026-04-21T10:04:18","slug":"claude-code-gemini-cli-and-github-copilot-vulnerable-to-prompt-injection-via-github-comments","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2026\/04\/21\/claude-code-gemini-cli-and-github-copilot-vulnerable-to-prompt-injection-via-github-comments\/","title":{"rendered":"Claude Code, Gemini CLI, and GitHub Copilot Vulnerable to Prompt Injection via GitHub Comments"},"content":{"rendered":"<p>    Claude Code, Gemini CLI, and GitHub Copilot Vulnerable to Prompt Injection via GitHub Comments<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p>A critical cross-vendor vulnerability class dubbed\u00a0\u201cComment and Control\u201d\u00a0is a new category of prompt injection attacks that weaponizes GitHub pull request titles, issue bodies, and issue comments to hijack AI coding agents and steal API keys and access tokens directly from CI\/CD environments.<a href=\"https:\/\/oddguan.com\/blog\/comment-and-control-prompt-injection-credential-theft-claude-code-gemini-cli-github-copilot\/\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a><\/p>\n<p>The attack name is a deliberate play on the classic <a href=\"https:\/\/cybersecuritynews.com\/command-and-controlc2-server\/\" target=\"_blank\" rel=\"noreferrer noopener\">Command and Control (C2) framework<\/a> used in malware campaigns. Three widely deployed AI agents, Anthropic\u2019s Claude Code Security Review, Google\u2019s Gemini CLI Action, and GitHub Copilot Agent (SWE Agent), were confirmed vulnerable.<\/p>\n<p>According to researcher Aonan Guan, the entire attack loop runs within GitHub itself: an attacker writes a malicious PR title or issue comment, the AI agent reads and processes it as trusted context, executes attacker-supplied instructions, and exfiltrates credentials back through a PR comment, issue comment, or git commit, no external server required.<\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhqZ7gIQshsK70N-UVd9PPPU_KmT3ThSP1dyvgLrdD7b7I0hoPaVz9MJnzs_TERKSqPrr2N6uMu1T1DCMNjyg3oSuy9-K8Fq8itHoP10PLHVY-A9M61dPQiVzFpYbpEFHDLFpmrOReLkQimtvPxEp6OPIL4adoHUr8mPvGUQTfgAK_O80rMn4Ldg6SUxU44\/s16000\/Attack%2520Pattern.webp?ssl=1\" alt=\"\"><figcaption class=\"wp-element-caption\">Attack Pattern<\/figcaption><\/figure>\n<p>Unlike classic <a href=\"https:\/\/cybersecuritynews.com\/hackers-can-use-indirect-prompt-injection-allows-adversaries\/\" target=\"_blank\" rel=\"noreferrer noopener\">indirect prompt injection<\/a>, which is reactive and requires a victim to explicitly ask the AI to process a document, Comment and Control is\u00a0proactive: GitHub Actions workflows auto-trigger on\u00a0<code>pull_request<\/code>,\u00a0<code>issues<\/code>, and\u00a0<code>issue_comment<\/code>\u00a0events, meaning simply opening a PR or filing an issue can activate the agent without any victim interaction.<a href=\"https:\/\/oddguan.com\/blog\/comment-and-control-prompt-injection-credential-theft-claude-code-gemini-cli-github-copilot\/\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a><\/p>\n<h2 class=\"wp-block-heading\" id=\"finding-1-claude-code-security-review--pr-title-to\"><strong>Finding 1: Claude Code Security Review \u2014 PR Title to RCE<\/strong><\/h2>\n<p>In Anthropic\u2019s Claude Code Security Review action, the PR title is directly interpolated into the agent\u2019s prompt with zero sanitization. Because the Claude CLI is invoked without\u00a0<code>--disallowed-tools<\/code>\u00a0or\u00a0<code>--allowed-tools<\/code>\u00a0restrictions, the subprocess inherits all environment variables including\u00a0<code>ANTHROPIC_API_KEY<\/code>\u00a0and\u00a0<code>GITHUB_TOKEN<\/code>.<\/p>\n<p>An attacker simply opens a PR with a malicious title that breaks out of the prompt context and instructs Claude to execute\u00a0<code>whoami<\/code>,\u00a0<code>ps auxeww<\/code>, or\u00a0<code>env<\/code>\u00a0\u2014 returning the full credential dump as a JSON \u201csecurity finding\u201d posted to the PR comment. Rated\u00a0CVSS 9.4 Critical\u00a0by Anthropic (upgraded from 9.3), the bug was reported via HackerOne (#3387969) and awarded a\u00a0$100 bounty.<a href=\"https:\/\/oddguan.com\/blog\/comment-and-control-prompt-injection-credential-theft-claude-code-gemini-cli-github-copilot\/\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a><\/p>\n<h2 class=\"wp-block-heading\" id=\"finding-2-gemini-cli-action--issue-comment-to-api\"><strong>Finding 2: Gemini CLI Action \u2014 Issue Comment to API Key Leak<\/strong><\/h2>\n<p>Google\u2019s Gemini CLI Action includes issue titles, bodies, and comments in the agent\u2019s prompt context under an \u201cAdditional Content\u201d section. By injecting a fake \u201cTrusted Content Section\u201d immediately after it, an attacker overrides Gemini\u2019s safety instructions, causing Gemini to post the\u00a0<code>GEMINI_API_KEY<\/code>\u00a0as a public issue comment, visible to anyone.<\/p>\n<p>Reported to Google VRP (#1609699) by researcher Neil Fendley alongside Johns Hopkins University collaborators, the vulnerability earned a\u00a0$1,337 bounty.<a href=\"https:\/\/oddguan.com\/blog\/comment-and-control-prompt-injection-credential-theft-claude-code-gemini-cli-github-copilot\/\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a><\/p>\n<h2 class=\"wp-block-heading\" id=\"finding-3-copilot-agent--three-layer-defense-bypas\"><strong>Finding 3: Copilot Agent \u2014 Three-Layer Defense Bypass<\/strong><\/h2>\n<p>The GitHub Copilot Agent finding is the most technically sophisticated. GitHub had implemented three runtime-level mitigations\u00a0environment variable filtering,\u00a0secret scanning, and\u00a0network firewall\u00a0\u2014 all of which were bypassed:<a href=\"https:\/\/oddguan.com\/blog\/comment-and-control-prompt-injection-credential-theft-claude-code-gemini-cli-github-copilot\/\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a><\/p>\n<ul class=\"wp-block-list\">\n<li>\n<strong>Env Filtering Bypass:<\/strong>\u00a0The\u00a0<code>UU()<\/code>\u00a0function filters sensitive variables only from the child bash subprocess. Running\u00a0<code>ps auxeww<\/code>\u00a0from that subprocess reads\u00a0<code>\/proc\/[pid]\/environ<\/code>\u00a0of the unfiltered parent Node.js process and MCP server, recovering\u00a0<code>GITHUB_TOKEN<\/code>,\u00a0<code>GITHUB_COPILOT_API_TOKEN<\/code>, and two additional credentials.<a href=\"https:\/\/oddguan.com\/blog\/comment-and-control-prompt-injection-credential-theft-claude-code-gemini-cli-github-copilot\/\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a>\n<\/li>\n<li>\n<strong>Secret Scanning Bypass:<\/strong>\u00a0GitHub\u2019s scanner detects\u00a0<code>ghs_<\/code>\/<code>ghu_<\/code>\u00a0token prefixes. Base64-encoding the output before committing evades all pattern matching.<a href=\"https:\/\/oddguan.com\/blog\/comment-and-control-prompt-injection-credential-theft-claude-code-gemini-cli-github-copilot\/\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a>\n<\/li>\n<li>\n<strong>Firewall Bypass:<\/strong>\u00a0The encoded credential file is exfiltrated via a standard\u00a0<code>git push<\/code>\u00a0to a PR \u2014 a whitelisted operation \u2014 making it indistinguishable from normal Copilot workflow activity.<a href=\"https:\/\/oddguan.com\/blog\/comment-and-control-prompt-injection-credential-theft-claude-code-gemini-cli-github-copilot\/\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a>\n<\/li>\n<\/ul>\n<p>Adding another layer of stealth, the attack payload is hidden inside an\u00a0HTML comment\u00a0in the issue body, invisible in GitHub\u2019s rendered Markdown view but fully parsed by the AI agent.<\/p>\n<p>A victim sees only an innocent visible request and unknowingly assigns the issue to Copilot. The bug was reported via HackerOne (#3544297), initially dismissed as a \u201cknown issue\u201d but reopened after the researcher submitted reverse-engineered source code proof from Copilot\u2019s minified\u00a0<code>index.js<\/code>. GitHub ultimately awarded a\u00a0$500 bounty.<a href=\"https:\/\/oddguan.com\/blog\/comment-and-control-prompt-injection-credential-theft-claude-code-gemini-cli-github-copilot\/\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a><\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgvMZWgOgsEO-s0_Gq7iCxqLqPOjC5FfN4CoHq6HKrzoizy3Ujd7b9bNOTmf9rAytqWWyQGLifmFULfWKeejgZ6hkNqyw_k7Pr685W9BIbHteISsu3V5jlcqgjRznjQ_EhoW1DfmTwNT7WsQCykKxBtkP_r-_3HVz36QlQn38hYRzNWjMJ5-Hsz1hUUSW7e\/s16000\/claude-code-api-key-leak.webp?ssl=1\" alt=\"\"><\/figure>\n<figure class=\"wp-block-table\">\n<table class=\"has-fixed-layout\">\n<thead>\n<tr>\n<th class=\"has-text-align-left\" data-align=\"left\">Component<\/th>\n<th class=\"has-text-align-left\" data-align=\"left\">Injection Surface<\/th>\n<th class=\"has-text-align-left\" data-align=\"left\">Exfiltration Channel<\/th>\n<th class=\"has-text-align-left\" data-align=\"left\">Credentials Leaked<\/th>\n<th class=\"has-text-align-left\" data-align=\"left\">Bounty<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Claude Code<\/td>\n<td>PR title<\/td>\n<td>PR comment<\/td>\n<td>\n<code>ANTHROPIC_API_KEY<\/code>,\u00a0<code>GITHUB_TOKEN<\/code>\n<\/td>\n<td>$100<\/td>\n<\/tr>\n<tr>\n<td>Gemini CLI<\/td>\n<td>Issue comments<\/td>\n<td>Issue comment<\/td>\n<td><code>GEMINI_API_KEY<\/code><\/td>\n<td>$1,337<\/td>\n<\/tr>\n<tr>\n<td>Copilot Agent<\/td>\n<td>Issue body (HTML comment)<\/td>\n<td>Git commit<\/td>\n<td>\n<code>GITHUB_TOKEN<\/code>,\u00a0<code>COPILOT_API_TOKEN<\/code>, +2 more<\/td>\n<td>$500<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>All three vulnerabilities share the same architectural flaw:\u00a0untrusted GitHub data flows into an AI agent that holds production secrets and unrestricted tool access in the same runtime.<\/p>\n<p><a href=\"https:\/\/oddguan.com\/blog\/comment-and-control-prompt-injection-credential-theft-claude-code-gemini-cli-github-copilot\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">As researchers noted<\/a>, this is the first public cross-vendor demonstration of a single prompt injection pattern defeating multiple major AI agents including one that had three dedicated runtime defenses in place.<\/p>\n<p>Security experts warn the pattern extends well beyond GitHub Actions to any AI agent processing untrusted input with access to tools and secrets, including Slack bots, Jira agents, email agents, and deployment automation pipelines.<\/p>\n<h2 class=\"wp-block-heading\" id=\"recommended-mitigations\"><strong>Mitigations<\/strong><\/h2>\n<ul class=\"wp-block-list\">\n<li>\n<strong>Allowlist tools, never blocklist<\/strong>\u00a0\u2014 use\u00a0<code>--allowed-tools<\/code>\u00a0to grant only the minimum required capabilities; blocklisting (e.g., blocking\u00a0<code>ps<\/code>) is trivially bypassed with alternatives like\u00a0<code>cat \/proc\/*\/environ<\/code>.<a href=\"https:\/\/oddguan.com\/blog\/comment-and-control-prompt-injection-credential-theft-claude-code-gemini-cli-github-copilot\/\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a>\n<\/li>\n<li>\n<strong>Least-privilege secrets<\/strong>\u00a0\u2014 agents performing read-only tasks, like issue triage, should not hold\u00a0<code>GITHUB_TOKEN<\/code>\u00a0with write scope.<a href=\"https:\/\/letsdatascience.com\/news\/ai-agents-expose-github-credentials-via-prompt-injection-a5fbe85d\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a>\n<\/li>\n<li>\n<strong>Require human approval gates<\/strong>\u00a0before agents perform outbound actions or access credentials.<a href=\"https:\/\/letsdatascience.com\/news\/ai-agents-expose-github-credentials-via-prompt-injection-a5fbe85d\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a>\n<\/li>\n<li>\n<strong>Audit all AI agent integrations<\/strong>\u00a0in CI\/CD pipelines and monitor Actions logs for anomalous credential-access patterns.<\/li>\n<\/ul>\n<p class=\"has-text-align-center has-background\" style=\"background:linear-gradient(180deg,rgb(238,238,238) 94%,rgb(169,184,195) 100%)\"><strong>Follow us on <a href=\"https:\/\/news.google.com\/publications\/CAAqMggKIixDQklTR3dnTWFoY0tGV041WW1WeWMyVmpkWEpwZEhsdVpYZHpMbU52YlNnQVAB?hl=en-IN&amp;gl=IN&amp;ceid=IN:en\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Google News<\/a>, <a href=\"https:\/\/www.linkedin.com\/company\/cybersecurity-news\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">LinkedIn<\/a>, and <a href=\"https:\/\/x.com\/cyber_press_org\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">X<\/a> for daily cybersecurity updates. <a href=\"https:\/\/cybersecuritynews.com\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Contact us<\/a> to feature your stories.<\/strong><\/p>\n<p>The post <a href=\"https:\/\/cybersecuritynews.com\/prompt-injection-via-github-comments\/\">Claude Code, Gemini CLI, and GitHub Copilot Vulnerable to Prompt Injection via GitHub Comments<\/a> appeared first on <a href=\"https:\/\/cybersecuritynews.com\/\">Cyber Security News<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Guru Baran<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/cybersecuritynews.com\/prompt-injection-via-github-comments\/\">Go to cyber-security-news<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Claude Code, Gemini CLI, and GitHub Copilot Vulnerable to Prompt Injection via GitHub Comments A critical cross-vendor vulnerability class dubbed\u00a0\u201cComment and Control\u201d\u00a0is a new category of prompt injection attacks that weaponizes GitHub pull request titles, issue bodies, and issue comments to hijack AI coding agents and steal API keys and access tokens directly from CI\/CD [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129,63,131,648],"tags":[130],"class_list":["post-12272","post","type-post","status-publish","format-standard","hentry","category-cyber-security","category-cyber-security-news","category-vulnerability","category-vulnerability-news","tag-cyber-security-news"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/12272"}],"collection":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/comments?post=12272"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/12272\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=12272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=12272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=12272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}