# PIR-2026-0026 - GitHub MCP "toxic agent flow": malicious issue coerces coding agents into leaking private repos

- `id`: PIR-2026-0026
- `title`: A public GitHub issue with hidden instructions coerces a user's coding agent (via the official GitHub MCP server) into exfiltrating the user's private repositories into a public PR
- `date_occurred`: not applicable - architectural vulnerability; demonstrated pre-disclosure
- `date_detected`: 2025-05 (Invariant Labs research)
- `date_disclosed`: 2025-05-26 (Invariant Labs blog)
- `status`: corroborated (primary writeup + independent coverage + GitHub issue #844)

### The agent
- `agent_description`: Coding agents (GitHub Copilot Agent, Claude) driven by the official GitHub MCP server (14k+ stars), used to triage issues and act across a user's repositories with the user's GitHub token.
- `operator_type`: individual / startup (developers running the agent against their own repos)
- `autonomy_level`: autonomous-within-policy (agent reads issues and can open PRs across repos without per-action human approval)
- `model_stack`: model-agnostic (demonstrated with Copilot Agent and Claude)
- `harness`: official GitHub MCP server + agent client (e.g. Claude Desktop, Copilot Agent)

### Authority
- `authority_scope`: data access (all repos the user's token can read, including private), code execution (opening PRs / writing to public repos), external comms (public PR content)
- `funds_at_risk_usd`: unknown (data-confidentiality incident)
- `blast_radius`: one org (the victim's repositories); exposure becomes public via the PR
- `failure_locus`: tool-mcp (the MCP server + agent architecture; Invariant framed it as an architectural flow, not a code bug in the server)

### The failure
- `root_cause`: prompt-injection (primary; untrusted issue content steers the agent)
- `mechanism`: An attacker files a public issue containing hidden instructions. When the victim asks their agent to triage open issues, the agent ingests the malicious issue, is coerced into reading the user's PRIVATE repositories (which its token can access), and autonomously opens a PR in a PUBLIC repo containing that private data. The chain bypasses GitHub's permission model because the agent legitimately holds the token; the flaw is the agent acting on untrusted input with over-broad token scope.
- `adversary_present`: yes (attacker files the poisoned issue; here, researchers)
- `exploitation_status`: researcher-demonstrated (Invariant Labs against the production GitHub MCP server; no confirmed real-world breach)

### Impact
- `severity`: near-miss (private-repo exfiltration proven; no realized third-party loss)
- `direct_loss_usd`: 0
- `indirect_loss_usd`: unknown
- `downtime`: none
- `data_exposure`: none realized; capability was full private-repo contents (source, secrets) leaked to a public PR

### Detection and recovery
- `detected_by`: third-party (Invariant Labs)
- `time_to_detect`: not applicable (proactive research)
- `time_to_recover`: not a single-fix event - Invariant stated there is no clean server-side patch; mitigation is architectural (scoped tokens, agent permission boundaries, human review of cross-repo actions)
- `remediation`: guidance-level - GitHub and downstream vendors advised least-privilege tokens and agent-side controls; Invariant proposed granular permission and dual-boundary controls
- `structural_fix`: none at the MCP-protocol level at disclosure time; the fix space is per-deployment (token scoping, review gates)
- `controls_that_worked`: none inherent - the incident's point is that the standard permission model did not bound it. Least-privilege token scope and human-in-the-loop on PR creation are the controls researchers recommend.

### Evidence
- `telemetry_grade`: none/researcher-demonstrated - the finding is a reproducible lab demonstration; no production telemetry of a real breach exists.
- `sources`:
  - https://invariantlabs.ai/blog/mcp-github-vulnerability
  - https://devclass.com/2025/05/27/researchers-warn-of-prompt-injection-vulnerability-in-github-mcp-with-no-obvious-fix/
  - https://www.docker.com/blog/mcp-horror-stories-github-prompt-injection/
  - https://github.com/github/github-mcp-server/issues/844
  - `independence`: strong - primary researcher writeup corroborated by independent trade press and a public tracking issue.
- `confidence`: high on mechanism, disclosure date, and architectural framing; the "no real-world breach" status is inherent to a research demo (weakest link: impact demonstrated, not observed in the wild)

### Verification notes
- Disclosure date (2025-05-26) and Invariant Labs attribution confirmed. Repo popularity (14k+ stars) consistent with reporting.
- Classification holds: `prompt-injection` root cause, `tool-mcp` failure_locus, near-miss severity with `researcher-demonstrated` exploitation_status. No correction needed.
