99% of Repository Access Tokens Never Expire, Creating Persistent Attack Surface
Written by AI from the linked story. Not reviewed by an editor. How this works
The vast majority of repository access tokens are configured without expiration dates, meaning that credentials issued for short-term projects or to non-human identities like AI coding agents persist indefinitely. If any of these tokens are compromised, attackers gain long-term, potentially undetected access to critical source code repositories. This reflects a systemic failure in identity lifecycle management, where token issuance is not paired with a corresponding revocation or expiration policy. The risk is amplified by excessive permissions, meaning a single compromised token could expose far more than intended. Organizations must treat non-human identities with the same rigor as human user accounts.
Tactical Insight
Immediate actions
- Audit all existing repository access tokens and immediately revoke any that are unused, orphaned, or associated with concluded projects.
- Set mandatory expiration dates on all existing tokens, prioritizing those with broad repository access or administrative privileges.
Long-term improvements
- Enforce a token lifecycle policy that requires short-lived credentials (e.g., 30–90 days) with automated expiration for all human and non-human identities.
- Apply the principle of least privilege to all repository tokens, scoping permissions to only the specific repositories and actions required for each use case.
- Integrate non-human identities (AI agents, CI/CD pipelines, bots) into your identity governance program with the same review cadence as human accounts.
Detection measures
- Implement continuous monitoring and alerting for token usage anomalies, such as access from unexpected IPs or at unusual times.
- Establish regular access reviews (at least quarterly) to identify and remove stale or over-privileged tokens across all code repositories.