Gheist Explained: How Stolen GitHub Tokens Are Draining Private Repo Secrets — and How to Stop It

Quick Answer

Gheist is an automated campaign, tracked by cloud security firm Wiz since September 15, 2026, that uses stolen GitHub tokens to plant a hidden workflow in private repositories. The workflow prints every secret the repository can reach into a GitHub Actions log — disguised with base32 encoding so GitHub’s normal secret masking misses it — and the attackers download the log and delete the run within seconds. More than 13,500 planted branches across over 850 compromised accounts have been recovered. If you find a branch named ci-sync- followed by six random characters in your repositories, assume every secret that repository could reach is exposed: revoke the token and rotate those secrets immediately.

Introduction

Most developers think of GitHub as the safe place where code lives. Secrets — API keys, cloud credentials, deployment tokens — are supposed to stay locked inside repository settings, never printed anywhere. Gheist breaks that assumption without breaking into GitHub at all. It does not exploit a vulnerability in the platform. It simply uses valid, stolen tokens and ordinary platform features: push a branch, add a workflow file, let GitHub Actions run it, read the log, delete the evidence.

That is what makes this campaign worth understanding. There is no patch to install and no firewall rule to add, because nothing is technically “broken.” The defense is entirely about how tokens are issued, how secrets are scoped, and how closely you watch your own repositories. This article explains, in plain language, how Gheist works, who is actually at risk, how to check whether your accounts were touched,

and the concrete changes that shrink the damage if a token ever leaks again.

What Is Gheist, and How Big Is It?

Gheist takes its name from the user agent string — gheist — that the attackers’ tooling sends with its GitHub API requests. That small fingerprint is how researchers connected thousands of otherwise quiet incidents into one campaign.

According to Wiz’s analysis, published October 25, 2026, the campaign has been running since at least September 15, 2026, and was still active and evolving as of October 24. The recovered scale is striking: more than 13,500 planted branches, spread across more than 850 compromised accounts, ranging from individual developers’ personal projects to the private repositories of enterprise organizations. About two-thirds of the identified accounts were no longer available on GitHub by late October, which suggests takedowns are having some effect — but the campaign itself has not stopped.

The tokens feeding the campaign reportedly come from infostealer malware logs and earlier supply chain compromises, with the March 2026 Trivy compromise cited as one source. In other words, many victims did not lose their tokens to GitHub at all. They lost them on a developer workstation infected with malware, or in an earlier incident, and the token kept working long after the original breach was forgotten.

How the Attack Works, Step by Step

Understanding the sequence matters, because each step leaves a trace you can hunt for.

Step 1: A stolen token opens the door. The attackers start with a GitHub personal access token or OAuth token belonging to a real user or automation account. If that token has permission to push code to a repository, that is all the access the campaign needs. No password, no second factor, no exploit.

Step 2: A lookalike branch appears. The tool creates a new branch named ci-sync- followed by six random characters — for example, something like ci-sync-a7f3k9. The name is deliberately boring. It sounds like a continuous integration housekeeping branch, the kind of thing busy teams ignore.

Step 3: One workflow file is committed. The branch contains a single file: .github/workflows/sync-check.yml, committed with the message “ci: sync config”. Pushing that branch automatically triggers GitHub Actions, because that is what workflows are designed to do.

Step 4: Secrets are printed into the log — encoded. The workflow dumps the job’s environment variables and every secret the repository or environment can access, but first encodes them in base32. This is the clever part. GitHub normally masks known secret values in workflow logs, replacing them with asterisks. But masking only works when the secret appears exactly as stored. A base32-encoded secret looks like a completely different string, so it sails straight through the filter and lands in the log in full.

Step 5: The log is downloaded, then everything is deleted. Seconds after the run finishes, the attackers pull the log through GitHub’s API and delete the workflow run — and often the branch too. A developer browsing repository history later sees nothing unusual. The evidence only survives in audit logs, which many smaller teams never check.

Step 6 (enterprise variant): The blast radius grows. In enterprise organizations, researchers observed the tool cycling through tokens from several users and automation accounts within minutes, cloning private repositories before planting the workflow. In some cases, stolen cloud credentials were later used to enumerate AWS Secrets Manager, and GitHub Actions runs on the planted branches assumed AWS roles without approval. One compromised token can therefore become a path into an organization’s cloud environment, not just its code.

A newer variant targets self-hosted runners. On October 19, 2026, a second variant added a job that hunts through the self-hosted runner machine itself — its filesystem, process environments, and mounted Docker containers — looking for 31 different credential formats, including cloud metadata, Kubernetes tokens, and API keys for AI providers such as Anthropic, Hugging Face, Groq, and NVIDIA. If your team runs self-hosted runners, this variant raises the stakes considerably: the runner machine itself becomes the target.

Why Private Repositories Are the Ones at Risk

Here is the twist that surprises most people. GitHub shipped a safeguard on July 28, 2026, that pauses suspicious workflow runs and requires approval first. That safeguard stopped every public-repository run researchers checked. But it does not apply to private repositories or GitHub Enterprise Server — and those are exactly the environments where the valuable secrets live: production API keys, deployment credentials, cloud access keys.

So the picture is uneven. Public repositories, which rarely hold real secrets, are protected. Private repositories, which hold the secrets that matter, are not covered by this particular control. Enterprise teams should not assume GitHub’s approval gate is watching their private repos, because for this campaign, it is not.

Am I Affected? How to Check Today

If you maintain repositories on GitHub, run these checks now — they take minutes and they are the same indicators researchers published:

  1. Search for ci-sync- branches. In every repository you own or administer, list branches and look for any branch starting with ci-sync-. Also search for the workflow file .github/workflows/sync-check.yml and the commit message “ci: sync config”. Any hit is a red flag, even if the branch has already been deleted — check your audit log next.
  2. Review the audit log for deleted runs. In private repositories and GitHub Enterprise Server, audit logs show runs on planted branches finishing and then being deleted by the gheist user agent. Search your organization’s audit log for that user agent string.
  3. Check for unexpected AWS role assumptions. If your repositories connect to AWS, review CloudTrail for workflow runs on unfamiliar branches assuming roles, or for Secrets Manager enumeration you cannot explain.
  4. Audit tokens, not just passwords. List personal access tokens and OAuth authorizations for your account and your organization’s automation accounts. Look for tokens you do not recognize, tokens created on dates you cannot explain, or tokens with broader scopes than the job requires.
  5. Check self-hosted runners. If you run self-hosted runners, inspect them for unexpected jobs around October 19 or later, and review what credentials were reachable from the runner environment.

Important: finding nothing in the repository history does not prove you are clean, because the campaign deletes its own traces. The audit log is the authoritative source. If you find a planted branch, do not just delete it and move on — deletion does not undo the exposure.

What to Do If You Find a Planted Branch

Treat it as a confirmed secret exposure, not a suspicious event:

  1. Revoke the token that pushed the branch immediately. Revoking stops further branches from being planted with that token.
  2. Rotate every secret the repository could reach. That means repository secrets, environment secrets, and any cloud or third-party credentials those workflows could access. Rotating only the obviously leaked ones is not enough — the workflow dumps everything reachable, so assume everything reachable is compromised.
  3. Check downstream systems. If cloud credentials were reachable, review cloud audit logs for unusual activity, such as Secrets Manager enumeration or unexpected role assumptions, and rotate those credentials too.
  4. Remove the planted branch and workflow file, and confirm no other branches or workflow files were added by the same token.
  5. Review other repositories the same token could reach. A token is rarely scoped to one repository. Check every repository it had access to.

This “rotate everything reachable” rule is the same hard lesson from other recent supply chain incidents: deleting a leaked secret is not the same as revoking it. A secret that was visible, even briefly, must be treated as known to an attacker.

How to Make a Stolen Token Far Less Dangerous

You cannot guarantee a token will never leak — infostealer malware and past breaches put that out of reach. You can, however, make a leaked token worth very little:

Give tokens the smallest scope possible. A token that can only read one repository cannot plant workflows in ten others. Fine-grained personal access tokens let you limit both the repositories and the permissions. Never hand a broad, owner-level token to an automation job that only needs to read or push to one repo.

Set short expiry dates. A token that expires in 30 days limits the window an attacker can use it. A token that never expires is a permanent spare key. Review and prune tokens regularly, and delete ones tied to former team members, old projects, or decommissioned automation.

Use GitHub Apps instead of personal tokens for automation. GitHub Apps have narrower, repository-specific permissions and their credentials can be rotated centrally. They also separate automation access from any individual developer’s account, so one person’s compromised workstation does not hand over the organization’s keys.

Require approval for workflow runs from new branches. GitHub’s approval controls exist precisely for this scenario. Enable required approval for workflows triggered by first-time contributors and unfamiliar branches where your plan supports it, especially on repositories with access to sensitive environments.

Protect your environments. Deployment environments can require manual approval and restrict which branches may deploy. If a planted branch cannot reach the production environment’s secrets, the campaign’s payoff collapses — even if the workflow runs.

Never print secrets in logs — and test your masking. Add a standing rule to code review: no workflow should ever echo environment variables or secrets, even for debugging. And remember that encoding tricks defeat masking, so the rule must be “never print them at all,” not “GitHub will hide them.”

Enable two-factor authentication everywhere. 2FA protects the GitHub account itself, which limits how easily an attacker can create or expand token access. It does not neutralize an already-stolen token, but it closes the easiest path to minting new ones. If you have not set it up yet, our step-by-step guide to two-factor authentication walks through every major account type.

Monitor the audit log, not just the code. Schedule a regular review of your organization’s audit log — weekly for small teams, continuously for larger ones. Look for branch creation outside normal workflows, deleted workflow runs, and unfamiliar user agents. Gheist’s cleanup works only against teams that never look.

Secure the developer workstation. Because many of these tokens start life in infostealer logs, endpoint protection, keeping browsers and operating systems updated, and never pasting tokens into untrusted tools all matter. A token stolen from a laptop is a token no repository setting can protect.

The Bigger Lesson: Your CI/CD Pipeline Is a Target

Gheist belongs to a pattern that has defined 2026’s biggest incidents: attackers are going after the machinery that builds and ships software, not just the software itself. When a workflow can read production secrets and run code automatically, compromising that workflow is as good as compromising the server — sometimes better, because it is quieter. The LiteLLM supply chain attack earlier in October showed the same logic from the other side: a leaked key that was deleted but never revoked eventually produced a malicious package release. Gheist shows the same logic aimed at ordinary developers’ repositories.

The practical takeaway is a shift in mindset. Treat tokens and workflow secrets with the same seriousness as production passwords. Scope them narrowly, expire them quickly, rotate them the moment they might have been seen, and watch the audit trail. Those four habits do not require new tools or a security team — they are settings and routines any developer or small team can adopt this week.

Frequently Asked Questions

What is the Gheist campaign? Gheist is an automated campaign, tracked by Wiz since September 15, 2026, that uses stolen GitHub tokens to plant hidden workflows in repositories. The workflows dump reachable secrets into GitHub Actions logs, encoded in base32 to bypass GitHub’s secret masking, and the attackers download the logs and delete the runs within seconds.

How do I know if my repository was hit by Gheist? Look for branches starting with ci-sync-, a workflow file named .github/workflows/sync-check.yml, or commits with the message “ci: sync config”. Check your organization’s audit log for workflow runs deleted by the gheist user agent — repository history alone is not reliable, because the attackers delete their traces.

Are public repositories affected? GitHub’s approval safeguard, shipped July 28, 2026, stopped the public-repository runs researchers checked. Private repositories and GitHub Enterprise Server are not covered by that safeguard, and those are where researchers saw secrets actually leave.

What should I do if I find a ci-sync- branch? Revoke the token that pushed it immediately, then rotate every secret the repository could reach — repository secrets, environment secrets, and any cloud credentials those workflows could access. Check your cloud audit logs for follow-on activity, and review every other repository the same token could reach.

Does two-factor authentication stop Gheist? 2FA protects your GitHub account from takeover, which helps prevent attackers from creating new tokens, but it does not neutralize a token that has already been stolen. The defenses that matter most for Gheist are narrow token scopes, short expiries, environment protections, and audit log monitoring — plus rotating everything a compromised token could reach.

Is there a patch for Gheist? No. Gheist does not exploit a software vulnerability in GitHub, so there is no patch or CVE to install. It abuses valid tokens and ordinary platform features, which is why token hygiene, secret rotation, and monitoring are the real fixes.

Key Takeaways

  • Gheist uses stolen GitHub tokens — not a GitHub vulnerability — to plant a hidden sync-check workflow on branches named ci-sync- plus six random characters.
  • The workflow dumps reachable secrets into Actions logs in base32 encoding, which bypasses GitHub’s normal secret masking, and the attackers download the log and delete the run within seconds.
  • More than 13,500 planted branches across over 850 accounts have been recovered, and the campaign was still active as of October 24, 2026.
  • GitHub’s July 2026 approval safeguard blocks public-repository runs but does not cover private repositories or GitHub Enterprise Server — exactly where the valuable secrets live.
  • If you find a planted branch, revoke the token and rotate every secret the repository could reach; deleting the branch alone does not undo the exposure.
  • The lasting fix is token hygiene: narrow scopes, short expiries, GitHub Apps for automation, protected environments, and regular audit log reviews.

Conclusion

Gheist is a reminder that the most dangerous attacks are often the quietest ones. No alarms, no malware on a server, no dramatic breach announcement — just a boring-looking branch, a workflow that runs for a few seconds, and secrets quietly leaving through the platform’s own API. The developers and teams who stay safe will not be the ones with the most expensive tools. They will be the ones who scope tokens tightly, rotate secrets the moment they might have been seen, protect their deployment environments, and actually read their audit logs. Check your repositories for ci-sync- branches today, and if you find one, act on the assumption that every reachable secret is already out. Then fix the habits that let a single stolen token do this much damage in the first place.

Source: Coverage of the Gheist campaign by The Hacker News, based on Wiz Research’s analysis: https://thehackernews.com/2026/10/gheist-uses-stolen-github-tokens-to.html

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top