Static API key abuse
A static API key has no expiry, no built-in scope beyond what was granted at creation, and no way to tell whether the caller presenting it is the workflow it was issued to or whoever found it in a public commit.
How it works
An API key is a static secret string that authenticates a caller, service or automation to an API. Anyone who holds the string can call the API as the identity it represents, with no login, no MFA and no expiry, until someone revokes it. It needs nothing more than a value pasted into a header, which is why it persists despite being the weakest common credential type.
The same pattern covers AWS IAM user access keys (IDs beginning AKIA, per AWS; temporary STS keys begin ASIA), personal access tokens, SaaS admin API tokens, service principal client secrets and platform admin tokens. The abuse path is consistent:
- The key leaks into a repository, config file, container image, CI log or ticket, or sits in a vendor's systems that are later breached.
- The attacker finds it, by scanning public commits or after some other foothold.
- The attacker tests it. One call such as AWS
GetCallerIdentityor a "who am I" endpoint confirms the key works and shows what it is. - The attacker enumerates and acts. With the key's standing rights they list resources, read secrets the key can reach, mint further keys for persistence, and exfiltrate or destroy data.
GitGuardian's August 2026 research on n8n shows the path end to end. Researchers found 4,576 unique n8n API tokens exposed in public GitHub commits across 1,255 hostnames. Of 896 reachable instances they tested, 321 accepted at least one leaked token, about 36 percent. With a working token, an attacker had read access to workflow definitions, stored credentials and data tables. They could also make a workflow use a stored credential against an endpoint of their choosing without ever seeing its value.
Chaining is common. At the Internet Archive, the attacker told BleepingComputer a token in an exposed GitLab config file opened the source code, which reportedly held unrotated Zendesk API tokens.
Why it works
The control assumption that fails is that possession of the key string is the same as authorization to use it. A static key is a bearer token: nothing ties it to a specific caller, network location or time window.
Second, these keys sit in the MFA blind zone. There is no interactive login for MFA, Conditional Access or session revocation to act on. In SSO-protected apps an admin API token is also a local login bypass: the identity provider never sees it, so deprovisioning the human who created it does not revoke it.
Third, keys outlive their context. Zeabur's shared-cluster admin tokens, created in January 2024, "had no expiry, had not been rotated" and sat in plaintext in a private configuration repository when an intruder used them in October 2026. When a vendor holds keys for many customers, one leak becomes a fan-out breach. CVE-2025-3928 in Commvault's web server put Metallic's Microsoft 365 app secrets for many tenants within an attacker's reach. CVE-2025-30066 turned the tj-actions GitHub Action into a pipe that printed CI secrets into public build logs.
How to detect it
- AWS. In CloudTrail,
userIdentity.type=IAMUserwith a long-termaccessKeyId(prefixAKIA) calling from a newsourceIPAddressoruserAgent. GuardDuty findingsCredentialAccess:IAMUser/CompromisedCredentials(a key Amazon threat intelligence believes is compromised),UnauthorizedAccess:IAMUser/MaliciousIPCaller,Discovery:IAMUser/AnomalousBehavior(unusualListAccessKeys,GetRolePolicyand similar calls) andPersistence:IAMUser/AnomalousBehavior(for example an anomalousCreateAccessKey). - Microsoft Entra workload identities. ID Protection raises
leakedCredentialsfor a service principal when its valid credentials turn up on GitHub, paste sites or breach data, andsuspiciousSigninswhen a service principal signs in with an unfamiliar IP, ASN, resource, user agent or credential type. Full details need Workload Identities Premium. - Okta.
system.api_token.createin the System Log, which records each new unscoped API token. An unexpected token is either persistence or a key someone is about to leak. - Source hosting. GitHub secret scanning runs automatically on public repositories and notifies partner providers, which may revoke the key. Treat a leak notice as an incident.
The limits are real. Legitimate automation is bursty, runs from shared cloud IP ranges, and changes endpoints whenever owners edit it. GuardDuty notes that for its credential-exfiltration findings, continued activity from a new source is learned as expected and stops alerting. Zeabur's intrusion ran for more than 16 hours without triggering an alert. Build a per-key baseline and assume detection will be late.
How to stop it
Ranked by effect:
- Replace static keys with short-lived, workload-issued credentials. Use IAM roles and STS, workload identity federation for CI and cross-cloud calls, managed identities, or certificates. Microsoft's remediation guidance for risky service principals recommends x509 certificates over secrets. A leaked value then expires quickly.
- Keep keys out of code, images and tickets. Inject them at runtime from a vault such as HashiCorp Vault or AWS Secrets Manager. Turn on secret scanning with push protection, using GitHub's own or a tool such as GitGuardian.
- Scope every key to the smallest set of actions and resources, and add network restrictions where the API supports them, so a leaked key is useless off your network.
- Give every key an owner and an expiry, and include API and automation tokens in the same access reviews as human accounts. See non-human identity and workload identity.
- Rotate completely after any exposure. That includes every downstream credential the leaked key could read, and every key a breached vendor held for you. At Cloudflare, four missed credentials were enough.
Seen in the wild
- Cloudflare, 2023: after the October 2023 Okta support breach, Cloudflare failed to rotate "one service token and three service accounts." An attacker used them from November 14, 2023 to reach Confluence, Jira and Bitbucket. Cloudflare then rotated more than 5,000 production credentials.
- US Treasury, 2024: an attacker obtained a key BeyondTrust used to secure its cloud remote support service, bypassed the service's security and reached Treasury workstations. BeyondTrust notified Treasury on December 8, 2024. Treasury attributed it to a China state-sponsored actor. How BeyondTrust's CVE-2024-12356 figured in the attack has not been disclosed.
- Codecov, 2021: an error in Codecov's Docker image build let an attacker extract a Google Cloud Storage credential. From January 31, 2021 they used it to alter the Bash Uploader so it sent customers' CI environment variables to an outside server.
- GitHub, 2022-2023: a machine account's stolen personal access token cloned repositories holding code-signing certificates.
- Internet Archive, 2024: an exposed GitLab token, then Zendesk tokens that were still valid and used to send email on October 20.
- JadePuffer, 2026: Microsoft says a service principal's client secret had been exposed in a public GitHub issue and remained in its edit history. Storm-3168 used compromised service principals to request storage account keys and ran a destructive sequence lasting about seven minutes. See our coverage.
- Zeabur, 2026: a non-expiring admin token and an AWS key in plaintext exposed 321,810 accounts and 3,218,965 environment-variable records. See our coverage.
- LastPass, 2022: an AWS access key in an engineer's vault let the attacker copy LastPass customer vault backups.
- GitGuardian: 4,576 leaked n8n tokens, a third of reachable instances accepted them
- Related coverage: GitLab's incoming email address is a non-expiring token and 16,000 Supabase databases readable with the public key
Sources
- MITRE ATT&CK T1078.004: Valid Accounts: Cloud Accounts
- MITRE ATT&CK T1552.001: Unsecured Credentials: Credentials In Files
- AWS IAM identifiers: unique ID prefixes
- AWS CloudTrail userIdentity element
- Amazon GuardDuty IAM finding types
- Entra ID Protection: workload identities
- Okta event types catalog
- GitHub Docs: about secret scanning
- Cloudflare: Thanksgiving 2023 security incident
- Codecov: Bash Uploader security update
- Nextgov: hackers accessed Treasury documents
- Infosecurity Magazine: stolen tokens and the Internet Archive
- Microsoft Security: Storm-3168 attacks using compromised service principals
- Zeabur: October 2026 security incident
Related identity CVEs and breaches
In the Identity Breach Database
Real incidents in our sourced breach database where this technique was used.
- Zeabur shared cluster breached with a non-expiring admin token and plaintext AWS keys 2026 · Exposed secrets
- JadePuffer wipes Azure resources with compromised service principals 2026 · Exposed secrets
- US Treasury workstations accessed through a stolen BeyondTrust Remote Support key 2024 · Third-party access
- Internet Archive user database theft and Zendesk token abuse 2024 · Exposed secrets
- Cloudflare Atlassian intrusion with credentials left unrotated after the Okta breach 2024 · Stolen credentials
- GitHub repositories cloned with a compromised machine-account token 2023 · Stolen credentials
- LastPass customer vault backup theft via engineer credentials and trusted device cookie 2022 · Stolen credentials
- Codecov Bash Uploader compromise via credential extracted from Docker image 2021 · Exposed secrets
Related on Start with Identity
- GuideAPI Key Rotation Automation Guide
A practical guide to automating API key rotation with zero downtime, covering rotation strategies, secrets management integration, dual-key patterns, monitoring
- BlogOkta ships Agent SSO, making AI agents first-class identities instead of static API keys
Okta made Agent SSO generally available on August 24, 2026, registering AI agents in Universal Directory with short-lived governed tokens and pushing Cross App
- BlogA phantom join key let anyone mint JFrog Artifactory admin tokens, and exploitation started in days
CVE-2026-82329 (CVSS 9.8) is an authentication bypass in JFrog Access. Instances without an explicit join key got a predictable one, letting an unauthenticated
- TechniqueAD CS certificate template abuse
A certificate template with permissive enrollment rights or a misconfigured extension turns Active Directory Certificate Services into a path to domain compromi
- BlogApache OFBiz 24.09.08 fixes a hard-coded JWT key, a password reset takeover and default-open REST auth
Apache OFBiz 24.09.08, announced November 4, fixes a batch of authentication flaws: a hard-coded JWT key giving unauthenticated admin access, a password reset f
- GlossaryAuthZEN (Authorization API)
AuthZEN is the OpenID Foundation working group, and the [Authorization API 1.0](https://openid.net/specs/authorization-api-1_0-final.html) specification it prod