Stolen GitHub Tokens Are Quietly Exposing Your Private Code

·
Listen to this article~4 min
Stolen GitHub Tokens Are Quietly Exposing Your Private Code

A new campaign called Gheist is using stolen GitHub tokens to plant workflows that leak secrets from private repositories. Learn how it works and how to protect your code.

Imagine waking up to find that your private GitHub repositories—the ones you thought were locked down tight—have been leaking secrets. Not because of a sophisticated zero-day, but because attackers used stolen tokens to slip malicious workflows into your code. That's exactly what's happening with a campaign called Gheist, and it's hitting private repos and GitHub Enterprise environments hard. ### How Gheist Turns Your Own Logs Against You Here's the kicker: the attack doesn't need to break in through the front door. Instead, it uses stolen GitHub tokens to plant workflows that print your repository's secrets—like API keys, passwords, and tokens—directly into the GitHub Actions logs. Then, the attackers simply download those logs and delete the runs, covering their tracks. According to cloud security company Wiz, this has already succeeded in private repositories and GitHub Enterprise environments. ### The Safeguard That Pauses—But Doesn't Stop GitHub has a safeguard that pauses workflows when it detects potential secret exposure, but it's not foolproof. The attackers have found ways around it, likely by crafting workflows that don't trigger the pause or by exploiting gaps in the detection logic. It's a reminder that even well-intentioned security features can be bypassed with enough creativity and patience. > "The automation and scale of this campaign are what make it particularly dangerous," noted a Wiz researcher. "Once an attacker has a valid token, they can quietly set up these workflows across multiple repositories without raising alarms." ### Why This Matters for Antidetect Browser Users If you're using antidetect browsers to manage multiple online identities, you're probably already careful about tokens and access. But this attack highlights a broader lesson: your security posture is only as strong as your weakest token. A single leaked GitHub token can undermine your entire operation, especially if you're managing multiple accounts or repositories. - **Audit your tokens regularly**: Revoke any tokens you're not actively using and rotate them frequently. - **Monitor workflow changes**: Set up alerts for any new or modified workflows in your repositories. - **Use fine-grained permissions**: Limit token scopes to only what's necessary for each task. - **Enable secret scanning**: GitHub's secret scanning can catch accidental exposures before they're exploited. ### What You Can Do Right Now Start by checking your GitHub Actions logs for any suspicious workflow runs. Look for workflows that print environment variables or secrets—even if they seem benign. If you find anything unfamiliar, delete the workflow and revoke the associated tokens immediately. And don't forget to review your organization's access logs for any unusual activity. ### The Bottom Line Gheist is a wake-up call for anyone who thinks private repositories are inherently safe. Attackers are getting smarter, and they're using our own tools against us. Stay vigilant, keep your tokens close, and never assume that "private" means "secure."