Malicious GitHub issue hijacks agents using GitHub's MCP server to leak private repo data
Invariant Labs showed that an attacker could plant a prompt injection in an issue on a user's public repository; when the user asked an agent connected to GitHub's official MCP server to look at the open issues, the agent pulled information from the user's private repositories and published it in a pull request on the public repository. The researchers said the problem was architectural rather than a bug in the server code, so GitHub could not fix it with server-side patches alone, and recommended limiting agents' repository access and monitoring their tool calls.
Invariant recommended limiting an agent's access to only the repositories it needs, following least privilege. It noted that Claude Desktop asks users to confirm individual tool calls by default, but that many users opt for an 'Always Allow' policy.
What would have stopped it
Limit an agent's GitHub access to only the repositories the task needs.
Guardrails
- G1 Least privilege Failed The agent's GitHub access covered all the user's repositories, including private ones.
- G2 Human confirmation Partial Claude Desktop asks to confirm each tool call by default, but many users choose 'Always Allow'.
- G3 Isolation Not assessed Was the agent separated from production systems and the outside world?
- G4 Instruction integrity Failed The agent obeyed instructions written by an outsider in a public issue.
- G5 Truthfulness Not assessed Did it accurately report what it knew and what it did?
- G6 Limits Not assessed Was there a cap on rate, spend, volume or scale?
- G7 Oversight Not assessed Could a responsible human see what it was doing and stop it in time?
- G8 Recovery Not assessed Could the damage be undone?
Sources
-
“The vulnerability allows an attacker to hijack a user's agent via a malicious GitHub Issue, and coerce it into leaking data from private repositories.”
-
“This is the lethal trifecta for prompt injection: access to private data, exposure to malicious instructions and the ability to exfiltrate information.”
-
“The issue is not a flaw in the GitHub MCP server code, but rather an architectural issue, says research engineer Marco Milanta and CTO Luca Beurer-Kellner.”
Confidence 89% comes from these sources alone. How we score
History
- 14 Oct 2026Entered in the register with 3 sources