GitHub Actions Secret Theft: Attack Patterns, Investigation, and Response
When a GitHub token is stolen, secrets in repositories where it can change workflows are also at risk. An attacker can plant a malicious workflow to target the secrets available to a job that is allowed to run.
This post covers four public attack reports and an anonymized GitHub and Azure incident. It examines the incident timeline and established scope, then explains how to check repositories, respond, and reduce the risk of a repeat.
At a glance
Section titled âAt a glanceâ| Case | Entry point | How secrets leave | Where traces remain |
|---|---|---|---|
| tj-actions/changed-files (2025-03) | Tampered tags of a widely used Action | Read from runner memory and printed to the log | Workflow run logs |
| Shai-Hulud (2025-09) | npm package install script | Stolen PAT plants a workflow that sends secrets out | New workflow file in the repository |
| GhostAction (2025-09, 2026-08 to 10) | Workflow pushed with a hijacked account | Reads the secret names the existing workflows use and sends them out | Commits, outbound requests |
| Gheist (2026-09 onward) | Workflow pushed with a stolen token | Base32 into its own log, log downloaded, run deleted | Commits (branches are deleted) |
| Anonymized GitHub and Azure incident | Malicious pushes using account permissions; initial exposure path unresolved | Secret references and base32 output code recovered | Commits, cloud sign-in and management records |
Figure 1. Different entry points target secrets available during execution. Original conceptual diagram based on the GitHub advisory and the Checkmarx, GitGuardian, and Wiz reports cited in the cases below.
Major cases
Section titled âMajor casesâtj-actions/changed-files: a third-party Action as the entry point
Section titled âtj-actions/changed-files: a third-party Action as the entry pointâOn March 14 and 15, 2025, an attacker repointed several version tags of tj-actions/changed-files to a malicious commit. According to the GitHub security advisory, more than 23,000 repositories used this Action. The malicious code printed the secrets of the running runner into the workflow log. For public repositories, anyone could read those logs. The incident was registered as CVE-2025-30066.
In this case, the repository owners did nothing wrong. Pinning an Action by tag, such as @v45, follows the tag wherever it moves.
Shai-Hulud: a package install as the entry point
Section titled âShai-Hulud: a package install as the entry pointâAn npm worm that appeared in September 2025. According to Checkmarxâs analysis, infected packages collected GitHub tokens, npm tokens and cloud credentials from the developer environment in an install script. They then used the stolen token to plant shai-hulud-workflow.yml in every repository it could reach. That workflow sent the repositoryâs secrets to the attackerâs webhook.
It started on a developer machine and spread into CI. A PAT stored in plain text in a development environment can travel this way.
GhostAction: going after existing secret names
Section titled âGhostAction: going after existing secret namesâGitGuardian reported this attack in September 2025. 3,325 secrets left 817 repositories across 327 accounts. The attacker used hijacked accounts to push a workflow named âGithub Actions Securityâ. The workflow read the secret names the repositoryâs existing workflows already used and sent them to an external server with curl.
It came back in 2026. According to GitGuardian, it targeted 772 public repositories between August 31 and September 30, and on October 8 and 9 it spread to more than 30,000 repositories of 3,000 users and organizations. GitHub started blocking the workflow from running on October 9.
Gheist: exfiltration through logs, no external server
Section titled âGheist: exfiltration through logs, no external serverâWiz has tracked this attack since September 15, 2026. More than 13,500 branches were found across more than 850 accounts. With a stolen token, the tool creates a ci-sync- branch and commits a sync-check.yml workflow. The workflow base32-encodes secrets and prints them into its own run log. The tool downloads the log through the API and deletes the run seconds later.
Figure 2. The run log acts as the exfiltration channel instead of an external server. Original diagram based on Wizâs Gheist analysis. Secret access here is limited to what the job is allowed to read; the diagram does not imply automatic bypass of environment approval rules.

Figure 3. An ordinary job log example supplied by GitHub, not an attack capture. Logs can be downloaded through the UI or API, so a value printed there has left secret storage. Source: GitHub Docs, Using workflow run logs, GitHub, Inc., CC BY 4.0, used unchanged.
Wiz explains three details that make it work.
- GitHub masks a secret in logs only when it appears verbatim. A base32-encoded value is not masked.
permissions: {}restricts onlyGITHUB_TOKEN. It does not restrict thesecretscontext.- If the repository has deployment environments, the tool builds one job per environment and reads environment secrets too.
According to Wiz, a recent GitHub control blocks this attack in public repositories. In private repositories and GitHub Enterprise environments, however, it has succeeded.
An anonymized GitHub and Azure incident
Section titled âAn anonymized GitHub and Azure incidentâUnfamiliar workflows appeared across several repositories under a developerâs GitHub account. The branches were soon deleted, and the relevant workflow runs were no longer available when the investigation took place. At almost the same time, Azure recorded an application identity, a service principal, signing in, model deployment changes, and API key operations.
Account names, repository names, organization names, and addresses are omitted. The records in this case are incident material separate from the public reports cited above.
Incident timeline
Section titled âIncident timelineâTaking the first malicious push as the reference point produces the following timeline. The relative times describe the order of observed events, not a proven credential transfer.
| Time | Observed record | Source |
|---|---|---|
| About one hour earlier | Similar workflows were pushed to other repositories under another memberâs account. | GitHub events and commits |
| Reference point | A malicious workflow was pushed under the account being investigated. | GitHub events and commits |
| About two minutes after the first push | An anomalous cloud service principal sign-in was identified. | Azure sign-in records |
| About one to two minutes after each push | The newly created branches were deleted. | GitHub events |
| Over roughly thirty minutes | Malicious workflows were pushed to eight repositories under the account being investigated. | Repository events and commits |
| At investigation time | The relevant Actions runs were unavailable, while Azure retained model deployment and API key operations. | Run listings and Azure management records |
Recovered evidence and assessment
Section titled âRecovered evidence and assessmentâFigure 4. Original evidence map based on the incident records. Solid boxes represent recovered evidence and established scope; the dashed connection indicates proximity in time. Unresolved questions are grouped below. It does not depict a proven credential transfer. The PlantUML source is stored alongside the image.
| Question | Assessment | Evidence and remaining scope |
|---|---|---|
| Were malicious workflows pushed? | Confirmed | Events and commits established the pushes. |
| Did the workflows target secrets? | Confirmed | The recovered code referenced secrets and printed base32 output. |
| Were all requested secrets actually exfiltrated? | Unresolved | Neither the run output nor the values received by the attacker were recovered. |
| Were cloud credentials abused? | Confirmed | An anomalous sign-in and subsequent management operations were identified. |
| Was the PAT obtained from another memberâs secret? | Inferred | The timing and secret purpose align, but the token used was not identified. |
| Were repository contents exfiltrated in bulk? | Unresolved | Available clone statistics showed no sign of bulk cloning. Those statistics cannot reveal file reads through the API. |
| How much was the service used, and what was the financial impact? | Unresolved | Management records alone cannot establish service request volume or billing impact. |
Common patterns: why this is hard to stop
Section titled âCommon patterns: why this is hard to stopâ- It may run before a merge. A workflow triggered by a push may run without merging into the default branch. Trigger conditions and approval settings determine whether it executes.
- It targets secrets available to the job. Repository and organization secret access rules and environment protections matter.
- Transformed values may escape redaction. Do not assume encoded output will be masked automatically.
- It reduces visible traces. Deleted branches and runs become harder to find in the interface. Missing records alone do not establish whether a workflow ran.
- It looks like normal work. Commits carry the victimâs own name, and branch names and messages look ordinary.
Checking whether your repositories were hit
Section titled âChecking whether your repositories were hitâFigure 5. Original diagram of what each investigation source can show. Correlate these sources using the commands and methods in the sections below.
Look for clustered activity in account events
Section titled âLook for clustered activity in account eventsâThe account events API shows branch creation, pushes and deletions from the last 90 days. Be suspicious of âcreate branch, push, delete branchâ repeated across several repositories in a short time.
gh api "users/<user>/events?per_page=100" --paginate \ --jq '.[] | [.created_at, .type, .repo.name, (.payload.ref // "")] | @tsv'Commits on deleted branches can still be opened
Section titled âCommits on deleted branches can still be openedâDeleting a branch does not make its commit unreachable right away. Use the head SHA recorded in the PushEvent to recover the malicious workflow.
gh api repos/<owner>/<repo>/commits/<sha> --jq '.files[].filename'gh api "repos/<owner>/<repo>/contents/<workflow-path>?ref=<sha>" --jq .content | base64 -dNarrow down the exposure
Section titled âNarrow down the exposureâMatch the secret names the malicious workflow read against where the repositoryâs original workflows use each one. Secret values cannot be read through the API, but names and usage tell you a lot.
| Usage in the original workflow | What it tells you |
|---|---|
gitops_token: ${{ secrets.X }} | A GitHub PAT that pushes to another repository |
argocd_auth_token: ${{ secrets.X }} | An Argo CD API token, not a GitHub PAT |
password: ${{ secrets.X }} (docker login) | A registry password |
Identify the tokenâs owner through the person who registered the secret, issuance records, and audit evidence. Neither organization member counts nor secret names establish that a PAT belongs to a particular person.
Traces on the cloud side
Section titled âTraces on the cloud sideâIf a cloud credential is suspected, check Azure service principal sign-ins and Activity Log operations such as listKeys, regenerateKey, and deployment creation. Compare the caller, timing, and source IP with normal automation. Timing and IP alone do not establish how a particular secret was transferred.
What clone statistics can and cannot show
Section titled âWhat clone statistics can and cannot showâThe Traffic API shows git clones per day for the last 14 days. It tells you whether a private repository with no usual clones was cloned during the attack.
gh api repos/<owner>/<repo>/traffic/clones --jq '.clones[] | [.timestamp, .count, .uniques] | @tsv'However, reading file contents through the API does not show up here. No clones does not mean nobody read the contents.
Reading the security log
Section titled âReading the security logâIn your accountâs Settings, Security log, look at events such as oauth_authorization, oauth_access, user.add_email and two_factor_authentication. Not every entry is suspicious. A GitHub App such as Copilot, for example, creates a token when you sign in (oauth_access.create) and may issue it again (oauth_access.regenerate). If the IP is yours and the app is one you use, it is normal.
Limits of Free organizations
Section titled âLimits of Free organizationsâThe audit log API and git events such as clones are GitHub Enterprise Cloud features, so Free organizations cannot use them. Who read what with which token can only be answered by GitHub Support.
Response order
Section titled âResponse orderâ- Revoke tokens and sessions. Every PAT, unknown OAuth app and GitHub App authorizations, SSH keys, signed-in sessions.
- Rotate exposed secrets at their issuer. Deleting the GitHub secret is not enough. A value that already got out stays valid until you revoke it in the cloud, registry, database or external API.
- Check for persistence. Deploy keys, webhooks, self-hosted runners, app installations, organization invitations, outside collaborators.
- Check usage of keys that cost money. LLM API keys and cloud AI service keys can be used heavily right after theft.
- Clean secrets out of git history. How to do that is covered in Finding and Removing Secrets from Git History.
Preventing a repeat
Section titled âPreventing a repeatâ- Use fewer classic PATs. Use fine-grained PATs or GitHub App tokens with short expiry. Do not put your PAT in the secrets of repositories other people use.
- Switch cloud access to OIDC. Azure and AWS both support GitHub Actions OIDC. There is no stored secret left to steal.
- Keep deployment secrets in environments. With approval rules and branch restrictions, not every branch can read them.
- Tighten organization settings. Require 2FA, set
GITHUB_TOKENto read by default, restrict allowed Actions, lower the default member permission. - Pin third-party Actions to a commit SHA. The tj-actions case shows that tags can move.
Limitations
Section titled âLimitationsâ- The numbers and behavior for each case are as of when each report was published. The attacks keep changing.
- GitHubâs control was reported for public repositories. For private repositories, check for yourself.
- The anonymized case did not establish attribution to a specific campaign or operator.
- Azure Activity Log primarily records management operations. Model calls and data reads require other evidence such as resource logs; management records alone cannot establish the full extent of data access or cost impact.
References
Section titled âReferencesâ- Material for the anonymized case: GitHub account events and commits, plus Azure sign-in and management records recovered during the investigation. Original identifiers and secret values are not published.
- GitHub Docs, Secrets
- Microsoft Learn, Azure Monitor activity log
- Gheist: Attempted Scaled Abuse of Stolen GitHub Tokens Stumbles, Wiz
- The GhostAction Campaign, GitGuardian
- GhostAction Returns, GitGuardian
- Inside Shai-Huludâs Maw, Checkmarx
- tj-actions/changed-files security advisory GHSA-mw4p-6x4p-x5m5