GitHub Copilot Flaw Allows Attackers to Steal Source Code from Private Repositories
A vulnerability in GitHub Copilot Chat, identified in June 2025, exposed private source code and sensitive information. This security flaw, rated CVSS 9.6, involved a Content Security Policy bypass combined with remote prompt injection.
A vulnerability in GitHub Copilot Chat, identified in June 2025, exposed private source code and sensitive information. This security flaw, rated CVSS 9.6, involved a Content Security Policy bypass combined with remote prompt injection.
GitHub Copilot Chat, an AI assistant integrated into GitHub, assists developers by providing code explanations and suggestions. The tool accesses repository contents, necessitating secure handling of sensitive data. The vulnerability allowed attackers to inject instructions into pull request descriptions using invisible comments, a documented GitHub feature, influencing Copilot's actions.
The exploit involved embedding a hidden comment with a malicious prompt in a pull request description. Although not visible in the web interface, GitHub processed this comment, enabling Copilot to execute hidden instructions with the viewer's permissions.
Initial tests included simple messages, but researchers escalated to full command sets that searched for secrets, encoded files, and exfiltrated data via image URLs. While GitHub's Content Security Policy blocks external images, it reprocesses third-party URLs through its Camo proxy, appending an HMAC signature.
A vulnerability in GitHub Copilot Chat, identified in June 2025, exposed private source code and sensitive information.
Researchers pre-generated a dictionary of Camo URLs for each character and symbol. Copilot reconstructed exfiltration URLs at runtime, using these URLs to deliver private code in transparent 1×1 pixels to an attacker's server.
After the report, GitHub disabled image rendering in Copilot Chat to prevent the Camo bypass. A patch was released on Mon, Aug 14, 2025, removing the capability to process Markdown image tags, thereby closing the CSP bypass and remote prompt injection vector.
Developers are advised to update their Copilot Chat integrations and monitor pull requests for unusual hidden content to protect against similar threats.
Based on reporting by GBHackers.
