How did a hidden comment get GitHub Copilot to leak secrets?
Legit Security researcher Omer Mayraz hid a prompt in an invisible markdown comment in a pull request. When a user asked Copilot Chat about the PR, the prompt told it to search the repo for a key. Copilot rendered the key as tiny images, one per character, and the order they loaded spelled it out.
The breakdown
The research
Omer Mayraz at Legit Security found the flaw in June 2025 and reported it through HackerOne. Legit named it CamoLeak and rated it CVSS 9.6. It published the details in October 2025, and The Register covered it on Oct 9, 2025.
The hidden comment
GitHub supports markdown comments that do not show on the rendered page. Mayraz put a prompt inside one in a pull request. A person reading the PR sees nothing. Copilot Chat reads the raw text, so it sees the instructions.
Whose access it used
Copilot Chat runs with the permissions of the signed-in user. When a maintainer asks it about the PR, the hidden prompt tells it to search the code that user can reach for a secret. In the demo it looked for AWS_KEY.
Getting the secret out
GitHub sends images in chat through its own signed image proxy, called Camo, so an attacker cannot simply point Copilot at any URL. Mayraz got around that by generating a signed Camo link for every character ahead of time, each pointing to a 1x1 pixel image on a server he controlled.
The pixel alphabet
The prompt told Copilot to draw the secret using that alphabet of images. Each character became one image request, and the order the requests arrived spelled out the key.
How GitHub fixed it
As of Aug 14, 2025, GitHub disabled image rendering in Copilot Chat, which closed the channel the leak used.
What to do with it
An assistant reads text you cannot see and acts with your access. Treat anything it reads from a pull request, issue or page someone else wrote as untrusted, and limit what it can reach and where its output can go.
The question at the end of the video: What else can your assistant read that you can't see?
Sources
- Legit Security, Omer Mayraz, Oct 2025: CamoLeak, critical GitHub Copilot vulnerability leaks private source code
- The Register, Oct 9, 2025: GitHub patches Copilot Chat flaw that could leak secrets
- CSO Online, Oct 2025: coverage of the CamoLeak Copilot Chat flaw
FAQ
What is CamoLeak?
CamoLeak is a GitHub Copilot Chat vulnerability found by Omer Mayraz at Legit Security in June 2025 and rated CVSS 9.6. A hidden prompt in a pull request made Copilot find a secret and leak it through image requests.
How can a comment be hidden from people but not from Copilot?
GitHub markdown comments do not appear on the rendered page, so a reviewer never sees them. Copilot Chat reads the underlying text, so it reads and follows the instructions inside.
Is CamoLeak fixed?
Yes. As of Aug 14, 2025, GitHub disabled image rendering in Copilot Chat, which removed the way the secret was sent out.
How do I protect my repos from hidden prompts?
Treat text in pull requests and issues from other people as untrusted input to your assistant, keep secrets out of code it can search, and limit where its output can send data.
































