cd /news/ai-safety/stolen-github-tokens-pushed-13500-se… · home › topics › ai-safety › article
[ARTICLE · art-182515] src=dev.to ↗ pub= topic=ai-safety verified=true sentiment=↓ negative

Stolen GitHub Tokens Pushed 13,500 Secret-Dumping Branches. AI Keys Were on the List

Wiz Research reported that an automated campaign it calls Gheist used stolen GitHub tokens to plant more than 13,500 branches across over 850 compromised accounts, pushing a workflow file that prints the full secrets context to its run log in base32 and then deletes the run. A later variant targets self-hosted runners, scanning for 31 token formats including keys for Anthropic, Hugging Face, Groq and NVIDIA, plus cloud metadata and Kubernetes credentials. Wiz traced the tokens to infostealer logs and earlier supply-chain compromises such as the March Trivy incident.

recommendation

Scope CI secrets to the jobs that need them, avoid printing the secrets context, and audit for ci-sync-* branches and sync-check.yml workflows after any token exposure.

more in playbook: Securing agents and AI tools
by read6 min views11 publishedDec 5, 2026

If your repo has an ANTHROPIC_API_KEY secret so a coding agent can run in CI, a stolen GitHub token with push access could be enough to read it. It takes no exploit and no malicious package, only a push to a private repo.

On October 25, Wiz Research published its report on Gheist, an automated campaign it has tracked since September 15. Wiz says it recovered more than 13,500 planted branches from more than 850 compromised accounts, with figures current as of October 24. RuntimeWire reported the same numbers the same day.

The campaign takes its name from the gheist user agent its tooling sends to GitHub's API, per Wiz. It has no command-and-control server. The secrets leave through GitHub's own API, so there is no attacker domain for you to block.

For every repository a stolen token can reach, the tool creates a branch named ci-sync- plus six random characters and commits one file, .github/workflows/sync-check.yml, with the message "ci: sync config", according to Wiz. The commit is authored as the token's owner and unsigned.

The push triggers the workflow. The workflow prints the environment and the whole secrets context to its own run log, encoded as base32. Wiz explains why that matters: GitHub masks a secret in logs only when the exact value appears, so an encoded copy prints in full. The tool then downloads the log and deletes the run seconds later.

The workflow also sets permissions: {}, per the report, which restricts the GITHUB_TOKEN but does nothing to stop a job from reading secrets. And if the repository has deployment environments, one variant runs a job matrix over them, so environment-scoped secrets, often your production credentials, get printed too.

One push, one workflow, one log: the secrets leave through the run output, then the run is deleted.

Where did the tokens come from? Wiz says the sources it could trace fit two patterns: infostealer logs, and tokens exposed in earlier supply-chain compromises, such as the Trivy compromise in March.

Coding agents in CI usually authenticate with a repository secret. Anthropic's own Claude Code GitHub Actions docs say setup saves the credential as a repository secret named ANTHROPIC_API_KEY for an API key or CLAUDE_CODE_OAUTH_TOKEN for a subscription token. Nothing is wrong with that setup. But a workflow that dumps the entire secrets context takes whatever is in it, and an AI provider key is spendable money.

The later variant goes further. Wiz says it added a sync-host job aimed at self-hosted runners, which searches the home directory, workspace and system paths for 31 token formats, "including keys for AI providers such as Anthropic, Hugging Face, Groq and NVIDIA." The same job collects cloud metadata and runner and Kubernetes service account credentials, and tries the Docker socket to reach the host's root filesystem. Wiz also calls it buggy: it looks for the wrong runner key file and doesn't collect GCP or Azure tokens.

If this sounds familiar, it rhymes with a story from earlier this month: an infostealer that grabs .claude.json and Codex's config.toml. Stealers feed token dumps, and token dumps feed campaigns like this one.

Since July 28, GitHub Actions holds potentially malicious workflow runs until a collaborator with write access approves them. Wiz says every public Gheist run it checked sat at action_required. In its words: "The control worked, and the malicious payloads never ran."

The catch is scope. GitHub's changelog says the protection "currently applies to public repositories on github.com only," and GitHub Enterprise Server does not have it. In private repositories, Wiz reports that runs completed and were deleted, and cloud logs showed organizations' own workflows assuming AWS roles on attacker branches. In enterprise organizations, the tool cycled through several users' and automation accounts within minutes and cloned private repositories. Hours later, Wiz says, cloud credentials from the same organization were used to enumerate AWS Secrets Manager.

Do not approve a held sync-check run, and do not run code from a ci-sync branch. Both are on Wiz's list of response steps.

Wiz publishes the branch pattern ^ci-sync-[0-9a-z]{6}$. This loop uses the GitHub CLI to list matching branches across an organization's repositories:

ORG=your-org
for r in $(gh repo list "$ORG" --limit 1000 \
    --json nameWithOwner --jq '.[].nameWithOwner'); do
  gh api --paginate "repos/$r/branches" --jq '.[].name' \
    | grep -E '^ci-sync-[0-9a-z]{6}$' \
    | sed "s|^|$r: |"
done

A match whose only change is .github/workflows/sync-check.yml is the signature Wiz describes. An empty result is not a clean bill of health, though. Wiz says about two-thirds of the implicated accounts were no longer available on GitHub as of October 24, and a cleaned-up branch leaves no trace in this list.

So also look where deletion doesn't reach. Wiz's hunt steps: in your GitHub audit log, search for runs on ci-sync-* branches deleted within a minute of completing, and for activity with the gheist user agent. If your workflows use OIDC, check cloud audit logs for role assumptions whose subject includes a ci-sync- branch. On self-hosted runners, search for the files .gdmp_pat, .gdmp_patg and .gdmp_sweep, and for the string gdmp-pivot.

Branch names can be deleted. Audit logs and cloud role-assumption logs are where the trace stays.

If you find a hit, Wiz is blunt: rotate every secret available to the affected repositories, including organization and environment secrets. Deleting the run or the branch does not remove the exposure. Revoke the token that pushed the commit, check its owner's machine for an infostealer, and treat any self-hosted runner that ran a ci-sync branch, and its instance role, as compromised.

Rotation means the provider side too. Anthropic's docs note that if you delete a repository secret, "the credential it held stays valid". Revoke the key in the provider's console, then store the new one.

The durable fix is to give a stolen token less to find. A few changes, each backed by its vendor's docs:

id-token: write permission.token.actions.githubusercontent.com:sub. A subject like repo:your-org/app:environment:production will not match a ci-sync- branch.gh token.gh auth login --expiring. GitHub says a leaked access token then "becomes unusable within hours instead of lasting indefinitely." Wiz adds two more: prefer GitHub Apps or short-lived fine-grained tokens over personal access tokens, and run self-hosted runners as ephemeral hosts without Docker socket or unrestricted metadata access.

If your agent's CI key is still a plain repository secret, the OIDC exchange in the first bullet is the change that takes it out of the secrets context entirely.

Gheist rides on something event-driven systems take for granted: a push is an event, and whatever consumes it trusts the producer. Thinking about who gets to emit an event and what a consumer can reach is part of the ground the Event-Driven Architecture Pocket Guide covers. It's one of 8 short books in the Pocket Guides for Developers series, on agents, RAG, prompts, observability, events, databases and system design. I also build Hermes IDE, an IDE for running Claude Code, Codex and other coding agents side by side, each on its own branch.

── more in #ai-safety 4 stories · sorted by recency
── more on @wiz research 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/stolen-github-tokens…] indexed:0 read:6min 2026-12-05 · —