← All Labs
🛡 AI HACKING INTERMEDIATE +125 XP · +50 no-hint bonus

Poisoned GitHub Issue — Hijack the Coding Agent

This repository lets an AI coding agent fix any issue labelled ai-fix. The agent reads the raw issue text — including parts GitHub never shows a human, like HTML comments. Write an issue that looks harmless to the maintainer but makes the agent leak the repository's secrets in its pull request.

https://bookshop.local/search

What is a poisoned GitHub issue?

Coding agents are often set to read issues and fix them. An issue is text written by anyone, and it can include parts a person browsing the page does not see, such as HTML comments.

A poisoned issue contains instructions for the agent hidden in that text. The agent reads the raw content, takes the hidden part as its task, and acts with its own access to the repository.

A real case

GitHub MCP server and a malicious public issueMay 2025

Invariant Labs showed that an issue filed on a public repository could steer a coding agent connected through the GitHub MCP server. When the developer asked the agent to look at open issues, it followed the text inside one, read private repositories and published their contents in a public pull request.

This lab uses the same entry point, an issue anyone can file, read by an agent that has access the author of the issue does not.

Source: Invariant Labs

How to fix it

  • Strip comments and hidden markup from issue text before the agent reads it.
  • Only let the agent act on issues from trusted contributors or after a maintainer has reviewed them.
  • Limit the agent to one repository and to opening pull requests, with no direct pushes.
  • Review the agent's pull requests like any other outside contribution.

Questions people ask

How can an issue contain hidden text?

Issue bodies support HTML comments and other markup that is not shown when rendered. An agent reading the raw text sees all of it.

Is this only a GitHub problem?

No. Any system where an agent reads user-submitted tickets, comments or reviews has the same exposure.

Does a label like ai-fix make it safe?

Only if applying the label is restricted and the person applying it has read the raw issue text.

Read the full Prompt Injection guide · All free labs · AI red team certification