GitHub MCP agent copies private repository data into public pull request

GitHub MCP agent copies private repository data into public pull request

The agent moved data from private repositories into a publicly visible pull request because an issue written by a stranger asked it to.

26 May 2025DemonstratedHijacked by content
Official GitHub MCP server used with Claude Desktop (Claude 4 Opus) · GitHub (MCP server); Anthropic (agent client used in the demonstration) · Global
What happened
Research demonstration by a security firm; no confirmed in-the-wild exploitation. Invariant Labs created an issue containing instructions in a public repository. When the repository owner asked their agent to look at the open issues, the agent followed the issue text, read the owner's private repositories, and wrote their contents into a new pull request in the public repository. In the demonstration the leaked material included salary details, relocation plans and names of private projects. The agent's access came from a personal access token that covered all repositories the user could reach.
Response
Invariant stated the issue was architectural rather than a bug in the GitHub MCP server code and could not be resolved by a server-side patch, recommending fine-grained permissions and runtime guardrails. The sources do not report a GitHub patch.
Discovered by
Invariant Labs, using its automated security scanning of agentic systems.
Who was affected
Developers connecting AI agents to GitHub with personal access tokens covering public and private repositories
Patterns
Instructions hidden in contentData left the systemOff-script in public
Confidence: high · checked 24 September 2026. Published under CC BY 4.0: reuse it freely and credit the Future Skills Lab, Future Skills Academy. Seen an error or a newer development? Write to tellmemore@futureskills.academy.

Related

Incidents with the same pattern

What does this ask of people?

Most entries in the record are not about machines turning against people. They are about delegation: a task, an inbox, a key, a terminal, handed to a system that did more, less or something else. Futures literacy starts with noticing that.

All 177 incidents →The Future Skills Lab