How Stolen GitHub Tokens Can Expose CI/CD Secrets and Production Access

Summary
The article explains how stolen developer credentials can enable GitHub workflow changes and expose CI/CD secrets, then provides investigation, containment, revocation, recovery, and hardening guidance. Token theft alone does not prove secret theft or production access.
Key points
- A stolen OAuth token or personal access token may allow repository access or workflow changes, depending on its permissions and applicable policies; possession alone does not establish secret theft or production access.
- An attacker may be able to run a secret-accessing workflow from a feature branch without merging it into the default branch, if repository settings and secret protections permit.
- GitHub’s secret-management interfaces do not return stored plaintext values; the risk arises when an eligible workflow receives available secrets during execution.
- Interactive MFA does not require a fresh second factor for every request made with an already-issued token. Removing a user from an organization also does not necessarily invalidate the token globally.
- The article recommends correlating endpoint evidence, token and audit activity, workflow changes and runs, runner network evidence, and downstream cloud logs—while distinguishing possible exposure from confirmed misuse and impact.
- Defenses include limiting token permissions, reviewing feature-branch workflows, gating sensitive environment secrets, narrowing OIDC trust, isolating runners, and monitoring workflow changes and deletions.
- Recovery guidance includes containing access, preserving evidence, revoking credentials at their issuer, rotating credentials that were exposed or could not be ruled out, rebuilding affected machines, and verifying recovery before restoring access.
Article Details
- Defense Focus
- Detect and contain stolen developer credentials and malicious workflow activity across the path from developer endpoints to CI/CD secrets and downstream cloud systems.
- Detection Methods
- Review endpoint process history, package versions, project configuration, and IDE or AI-tool hooks to determine whether malicious code executed and which credentials it could access.
- Correlate GitHub audit and security events, token attribution where available, source locations, and repository activity across all branches with the suspected exposure window.
- Inspect workflow changes, triggers, run history, approvals, and secret-access policies for new or modified secret-accessing workflows, including bulk serialization with toJSON(secrets).
- Correlate runner network evidence and exported logs with suspicious workflow runs; investigate unexpected outbound connections and deleted runs.
- Review cloud audit trails, role assumptions, deployment records, identity changes, and package releases for downstream credential use or impact.
- Treat unfamiliar credential origins, geographic anomalies, volume changes, and use after a policy violation as investigation leads, not proof of compromise.
- Data Sources
- Endpoint process history, package versions, project configuration, and accessible-credential evidence
- GitHub security and audit events, token attribution where supported, source locations, and repository activity
- Workflow diffs, branches, commits, triggers, run history, approvals, and secret-access policies
- Runner network evidence, exported workflow logs, and workflow-run deletion audit events
- Cloud audit trails, role assumptions, deployment records, identity changes, and package-release records
- Rule Types
- Workflow-change detection for named secret references and bulk secret-context access such as toJSON(secrets)
- Endpoint malicious-file detection rules for known artifacts
- GitHub Enterprise audit-data detections for PAT country changes, volume anomalies, and use after a policy violation
- Workflow-run deletion audit alerts correlated with workflow edits and token activity
- Platforms
- Developer workstations and endpoint-management environments
- GitHub repositories and CI/CD runners
- Cloud control planes and identity providers
- Defensive Actions
- Restrict organizational access for the affected identity, isolate the suspected machine, contain risky automation, and record the exposure window.
- Revoke exposed OAuth authorizations and PATs at their issuer; do not treat password resets, membership removal, local credential deletion, or machine rebuilding as token revocation.
- Preserve forensic evidence before wiping the affected machine, then rebuild it from a trusted image and verify recovery before restoring access.
- Inventory credentials and determine which repositories, workflows, organization or environment secrets, runner credentials, and downstream systems were reachable.
- Rotate or revoke credentials the malicious execution could access when theft cannot be ruled out; investigate OIDC-issued sessions and correct overly broad trust conditions.
- Require review of workflow and release changes, pin actions to full commit SHAs, minimize job permissions, and gate sensitive secrets with protected environments and deployment restrictions.
- Use isolated, preferably ephemeral runners; constrain outbound network access and protect runner controls against unauthorized removal.
- Export relevant audit evidence outside the affected account's control and preserve it promptly, particularly where workflow-run deletion or limited retention may affect investigation.
MITRE ATT&CK
T1059 · Command and Scripting InterpreterMalicious code is described as launching through VS Code folder-open tasks and Claude Code session-start hooks, and through execution of compromised packages.T1078.004 · Cloud AccountsThe article describes malicious workflows potentially abusing overly broad GitHub OIDC trust to obtain temporary cloud access; it also reports that Todoist's workflow chain reached cloud access.T1195.001 · Compromise Software Dependencies and Development ToolsThe article describes compromised npm and AI-tool package releases, along with malicious extensions, as routes for delivering code into developer environments.T1528 · Steal Application Access TokenThe LiteLLM investigation confirmed abuse of a GitHub CLI OAuth token; the article also describes developer OAuth tokens as targets for theft.T1550.001 · Application Access TokenStolen GitHub OAuth tokens or PATs can be used to authenticate for repository operations, subject to the credential's permissions and policies.T1565.001 · Stored Data ManipulationThe article describes attackers pushing or modifying workflow files on branches so altered workflow logic can run and access available secrets.
Vendors
GitHubA compromised developer machine can become a route to production: stolen GitHub tokens, including OAuth tokens and personal access tokens (PATs), can enable source-code theft, malicious workflow changes, and CI/CDStepSecurityfrom the stolen credential to the systems it can access. SAP reporting; Todoist incident reporting; StepSecurity’s LiteLLM investigation.
Products
Apps & PATsApps & PATs provides supported application and token inventories, including fine-grained PATs and classic PATs with the documented platform integrations. Use it to review ownership, permissions, and token scope.Audit LogOnce a job is running, Harden-Runner supplies supported runtime visibility and egress enforcement. Audit Log and Deleted Workflow Runs views help investigators connect suspicious token activity to execution andClaude Codeand Hades describes planted editor and AI-tool configuration, including VS Code folder-open tasks and Claude Code session-start hooks, that can launch credential-stealing code with the developer’s local access. TheseDeleted Workflow RunsHarden-Runner supplies supported runtime visibility and egress enforcement. Audit Log and Deleted Workflow Runs views help investigators connect suspicious token activity to execution and attempted cleanup. TheDevice PolicyAt the developer-machine boundary, Secure Registry and Device Policy can reduce exposure through supported package and extension controls, while credential discovery and malicious-file detection help identify localGitHub Actions- How can stolen credentials expose GitHub Actions secrets?GitHub CLIcredentials led through modified workflows to cloud access; LiteLLM confirmed abuse of a GitHub CLI OAuth token. Security teams need to investigate the full path from the stolen credential to the systemsHarden-Runnerchanges and Workflow Run Policies address configured secret-access patterns. Once a job is running, Harden-Runner supplies supported runtime visibility and egress enforcement. Audit Log and Deleted Workflow RunsPAT GovernancePAT Governance can flag excessive age, missing or overly distant expiration, broad permissions, and inactivity. Configurable reminders and revocation automation help address policy violations when the requiredSecure WorkflowAt the repository and workflow boundary, Secure Workflow proposes hardening changes and Workflow Run Policies address configured secret-access patterns. Once a job is running, Harden-Runner supplies supported runtimeStepSecurity Secure Registryan approved registry. Where available, configure developer machines and CI to use StepSecurity Secure Registry or another organization-approved internal package registry that enforces security controls, andVS Codereporting on Miasma and Hades describes planted editor and AI-tool configuration, including VS Code folder-open tasks and Claude Code session-start hooks, that can launch credential-stealing code with theWorkflow Run PoliciesAt the repository and workflow boundary, Secure Workflow proposes hardening changes and Workflow Run Policies address configured secret-access patterns. Once a job is running, Harden-Runner supplies supported runtime
