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.
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
- Sources
- GitHub MCP Exploited: Accessing private repositories via MCPInvariant Labs, 26 May 2025
- MCP Horror Stories: The GitHub Prompt Injection Data HeistDocker, 14 Aug 2025
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
20 Aug 2025DemonstratedHijacked by contentReddit comment directs Comet browser agent to leak login credentialsRead →6 Jul 2026DemonstratedHijacked by contentPublic issue leads GitHub Agentic Workflows agent to post private repo data (GitLost)Read →Aug 2026HappenedAgents beyond intentPersonal assistant agent sends email for tester without asking firstRead →
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.