← All advisories
VV-015highAgent hijacking2025-05-26

GitHub MCP server: a public issue makes the agent leak private repos

Invariant Labs showed that a prompt injection planted in a public GitHub issue could get an agent using the official GitHub MCP server to pull data from the user’s private repositories.

01.

What it is

Published 26 May 2025. The agent has one GitHub token covering public and private repos; when it reads the attacker’s issue, the injected text asks it to fetch private data and post it publicly.

Invariant describes it as a “toxic agent flow”: the server works as designed, the danger comes from combining untrusted input with broad access.

02.

How to check

  1. Check what scopes the GitHub token used by your MCP server has, and whether it covers private repos.
  2. See whether your agent auto-approves GitHub tool calls.
03.

How to fix

  1. Give the agent a fine-grained token limited to the repos it needs.
  2. Turn off auto-approval for tools that write to GitHub.
04.

Sources

More advisories for this tool
The weekly email

One email a week. Only what changed.

New advisories, CVEs and fixes for Lovable, Bolt, v0, Replit, Base44 and Cursor apps. No roundups of things you already read.