The setup: A Sourcegraph developer accidentally committed a site-admin access token to a public GitHub repository in July 2023. The token sat there for roughly six weeks, undetected.
What happened: An attacker found the token, used it to gain admin-level access to Sourcegraph.com, and built a proxy application. The proxy offered anyone with a free Sourcegraph account unlimited access to Sourcegraph’s underlying LLM — at Sourcegraph’s expense. The proxy page received close to 2 million views before Sourcegraph detected the spike.
Detection: On August 30, Sourcegraph noticed an inorganic spike in API usage and began investigating. The malicious admin account was deactivated and rate limits were slashed site-wide.
Collateral damage: Sourcegraph temporarily reduced API rate limits for all free community users — the legitimate users paid for the attacker’s consumption through degraded service.
Per-user token quotas and real-time consumption monitoring. A budget alert at 10x normal usage would have fired within the first hour.