ericc-ch copilot-api Wildcard CORS Vulnerability Allowing Cross-Origin Token Theft

Vulnerability

A critical vulnerability exists in ericc-ch copilot-api versions through 0.7.0, specifically within the Token Endpoint's CORS configuration. The server's CORS policy is set to wildcard, allowing any domain to make cross-origin requests. This, combined with an open token endpoint that requires no authentication, creates a zero-click attack vector for stealing GitHub Copilot bearer tokens. The vulnerability can be exploited remotely, with the stolen tokens usable against the GitHub Copilot API.

Impact

Exploitation of this vulnerability leads to unauthorized access to the Copilot bearer token, allowing attackers to use the victim's Copilot subscription, including API abuse and token theft, with potential financial implications from Copilot quota consumption.

Reproduction

To reproduce this vulnerability, upload the provided proof-of-concept HTML file to a web server. Then, lure a victim to visit the page while they have copilot-api running locally. The exploit will automatically steal the Copilot token and usage data, demonstrating the API abuse by proxying chat completions through the Copilot API.

Remediation

To address this vulnerability, remove the unauthenticated token endpoint or require authentication. Additionally, restrict CORS to specific trusted origins and add bearer token authentication on all routes.

Added: Apr 20, 2026, 5:25 PM
Updated: Apr 20, 2026, 5:25 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
2.9
exploitability
7.3
remediation
0.0
relevance
6.3
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.