GitHub token hygiene is now an urgent operational priority: the SAP breach traces directly to stolen employee GitHub authentication tokens that granted attackers read-write access to source code. This checklist maps controls to NIST 800-53 AC-6 (Least Privilege) and GitHub Actions hardening guidance so your team can audit, rotate, and harden access before a credential theft becomes a supply-chain event.
Updated November 28, 2026
Key Takeaways
- SAP attackers obtained employee GitHub tokens enabling them to copy and alter source code repositories.
- A leaked token bypasses MFA entirely — from the platform’s view, the attacker is a legitimate engineer.
- In one documented incident, a single leaked key compromised more than 25 repositories in roughly two minutes.
- The GhostAction campaign exfiltrated 3,325 secrets from 817 repositories by injecting malicious workflow files.
What does the SAP incident actually tell us?
According to SecurityWeek, SAP confirmed it detected suspicious activity within GitHub. An insider cited by Der Spiegel reported that hackers obtained SAP employees’ authentication tokens, enabling them to copy and alter source code. SAP responded by replacing signing keys, limiting access to GitHub, and suspending automated development operations. SAP also told SecurityWeek it found no evidence of unauthorized access to customer business data.
The core vulnerability is the same in every incident like this: a classic personal access token with broad repo scope is a bearer credential that skips MFA, generates no login alert, and — from GitHub’s perspective — looks identical to a legitimate engineer at work. Rhythmic Technologies notes that in one documented incident a single leaked key compromised more than 25 repositories in approximately two minutes.
What should you check and revoke first?
If you suspect a token is compromised, the first hour is decisive. Treat every repository the token could reach as already cloned, including full commit history.
- Revoke the token immediately in GitHub org settings → Personal access tokens. Do not wait for the investigation to conclude.
- Revoke every other credential that identity holds — cloud IAM keys, deploy keys, npm tokens, and any secrets stored in GitHub Actions environments accessible to that user.
- Rotate all secrets reachable by that token: scan repository history (not just the latest commit — deleted secrets remain in git history), Actions secrets, and CI environment variables.
- Audit for attacker persistence: look for new deploy keys, added workflow files, new PATs or OAuth apps, and unexpected IAM role trust-policy edits. The GhostAction campaign injected a commit titled “Add Github Actions Security workflow” across 817 repositories and exfiltrated 3,325 secrets.
How do you prevent the next leak?
Rhythmic Technologies recommends nine controls in priority order. The highest-value changes address token scope and lifetime directly.
- Block classic personal access tokens at the org level and require fine-grained tokens scoped to specific repositories and permissions with enforced expiry.
- Replace long-lived tokens in automation with a GitHub App or short-lived OIDC federation, so there is nothing durable to steal from your pipelines.
- Scope cloud IAM roles tightly: pin trust policies to a specific repository and branch, require human approval for production environments, and alert on IAM actions such as access-key creation or trust-policy edits.
- Enable secret scanning with push protection to block commits containing recognizable secrets before they enter the repository.
- Pin third-party Actions to full commit SHAs, not mutable tags, to prevent a compromised action from running malicious code in your workflow.
Key figures from recent incidents
| Incident | Scale | Source |
|---|---|---|
| GhostAction campaign | 3,325 secrets across 817 repositories | Rhythmic Technologies |
| Shai-Hulud worm (Nov 2025) | ~25,000 repositories compromised; ~1,000 new repos every 30 minutes | Wiz |
| Nx compromise (Aug 2025) | 5,500+ private repos published from 400+ users and orgs | Wiz |
| Single leaked key (documented case) | 25+ repositories in ~2 minutes | Rhythmic Technologies |
Where do tokens come from in the first place?
Most teams focus supply-chain risk on application dependencies. Rhythmic Technologies points out that the developer’s own toolchain is an equally dangerous attack surface. Editor extensions such as VS Code plugins run with full user permissions and can read credential stores; the GlassWorm campaign spread through VS Code and OpenVSX extensions and stole GitHub, npm, and git credentials.
Package install scripts have triggered token theft at install time, with no import required. AI coding tools have also been exploited: the Nx malware prompted AI command-line assistants already on the developer’s machine to find credentials, which Wiz says worked in hundreds of cases. Tokens also surface in plaintext files in a home directory (.npmrc, .git-credentials, .env), shell history, CI logs, and screenshots pasted into chat. The malware in these campaigns is not sophisticated — it simply sweeps the disk and environment for anything that looks like a token. For a deeper dive into hardening your pipelines against these vectors, see our guide to securing GitHub Actions with OIDC federation.
Frequently asked questions
How did attackers exploit GitHub tokens in the SAP breach?
According to SecurityWeek, an insider cited by Der Spiegel reported that hackers obtained SAP employees’ authentication tokens, enabling them to copy and alter source code stored on GitHub. SAP subsequently replaced signing keys, limited access to GitHub, and suspended automated development operations.
Why is a stolen GitHub token more dangerous than a stolen password?
A stolen token bypasses MFA and login alerts entirely because it represents credentials that have already passed those checks. A classic personal access token with repo scope can read and write every repository its owner can reach with no additional approval required.
What is OIDC federation and why does it matter for CI/CD security?
OIDC federation lets a GitHub Actions workflow request a short-lived JWT from GitHub’s OIDC provider instead of storing a long-lived token. The temporary credential is valid only for that specific job, eliminating durable secrets that can be stolen and replayed.
How quickly can attackers act after a GitHub token is leaked?
Rhythmic Technologies reports that in one case a leaked key went from first use to more than 25 compromised repositories in about two minutes. In one Comparitech test using deliberately leaked AWS keys as bait, the first exploit attempt arrived inside sixty seconds.