Documented Incident · INC-OBS-001 · Critical severity
Official GitHub MCP Server Private Repository Exfiltration via Toxic Agent Flow
On May 26, 2025, Invariant Labs disclosed a critical cross-repository exfiltration attack against the official GitHub MCP server dubbed a Toxic Agent Flow. An attacker could plant hidden indirect prompt injection instructions inside an issue on any public repository maintained by a developer. When the developer asked an MCP-connected assistant such as Claude Desktop to review open issues, the agent followed the injected directive using the developer's over-scoped GitHub PAT to read private corporate repositories and publish stolen code and secrets into a public pull request. The disclosure drove industry adoption of fine-grained per-repository MCP tokens and runtime policy guards blocking cross-boundary data flows.
Incident dossier metadata
- Case ID
INC-OBS-001- Classification
- Incident
- Date
- Severity
- Critical
- Sector
- Software Development & AI Tooling
- Attack vector
- Indirect Prompt Injection
- System type
- MCP-Connected Developer Agents & Repository Integrations
- Reference URI
https://www.invariantlabs.ai/blog/github-mcp-exploited-accessing-private-repositories-via-mcp
Defensive takeaway
Scope MCP GitHub tokens to individual repositories, separate untrusted public issue triage from private repo read privileges, and gate public write tool calls.
Mapped AI security techniques
- Data from Information Repositories AML.T0036
- LLM Prompt Injection: Indirect AML.T0051.001
- AI Agent Tool Invocation AML.T0053
- Data from AI Services: AI Agent Tools AML.T0085.001
- Exfiltration via AI Agent Tool Invocation AML.T0086
- Prompt Infiltration via Public-Facing Application AML.T0093
Mapped defensive controls
- Manage AI Agent Service Access AML.M0026
- Manage User-Delegated AI Agent Access AML.M0027
- Enforce Access Controls for AI Agent Tools AML.M0028
- Human In-the-Loop for AI Agent Actions AML.M0029
- Restrict AI Agent Tool Invocation on Untrusted Data AML.M0030
Source citation records
- GitHub MCP Exploited: Accessing Private Repositories via MCP · Invariant Labs ·