Roguepilot How A Passive Prompt Injection Led To Github Repository Takeovers
A hidden prompt in a GitHub Issue caused Copilot to follow a symlink and read the Codespaces GITHUB_TOKEN, then exfiltrate it via a JSON schema download. An attacker could use the stolen token to push malicious commits or alter CI/CD workflows.
Published on infosecwriteups.com
Artificial Intelligence coding assistants have transitioned from experimental novelties to mandatory infrastructure for modern development teams. Tools like GitHub Copilot, Cursor, and Tabnine have deeply integrated themselves into our IDEs, promising massive boosts in productivity.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the AI agent treated untrusted issue content as instructions and its file-access guardrails checked only the symlink's location, not its resolved target, while VS Code automatically fetched remote JSON schemas.
Impact
The stolen token, scoped for read and write access, could let an attacker push malicious commits, alter release binaries, or manipulate CI/CD workflows.
What the attacker needed
Attacker can open an issue and PR; victim launches Codespace from issue; Copilot agent mode enabled
The fix
Microsoft and GitHub patched the vulnerability; the report also recommends treating context as untrusted, requiring human confirmation for agent actions, resolving symlink paths, disabling automatic schema downloads, and enforcing least privilege.
How it was found
- Attacker opens a GitHub Issue with hidden instructions in an HTML comment.
- Attacker creates a pull request containing a symlink that points to the secrets file.
- Developer launches a Codespace from the issue, and Copilot ingests the hidden prompt.
- Copilot runs a terminal command to check out the attacker's pull request.
- Copilot reads the symlink, which resolves to the secrets file, loading the token.
- Copilot creates a JSON file with a schema URL containing the token, triggering an outbound request.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
An AI coding assistant was tricked by instructions hidden inside a GitHub Issue. The assistant then read a secret access token from the development environment and sent it to an attacker-controlled server. The attacker could use that token to change the code repository.
What is AI / LLM?
Prompt injection, data exfiltration and tool abuse in features built on language models, and the ordinary bugs around them.