Join our Newsletter — 33% off our NHI Course
Home› Guides› Third-Party GitHub Action Compromise Response Playbook: Contain, Rotate…
Template Software & AI Supply Chain

Third-Party GitHub Action Compromise Response Playbook: Contain, Rotate and Recover After a Tag Hijack

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 18 November 2026 13 min read
On this page

When a third-party GitHub Action you depend on is compromised, every workflow that ran it during the exposure window must be treated as having leaked its secrets, and the response is a race between your rotation and the attacker's use of what was exposed. This playbook template gives security and platform teams a ready structure for that race: triggers, roles, triage, containment, credential rotation, recovery and review. It is built around the March 2025 compromises of reviewdog/action-setup and tj-actions/changed-files, where attackers retargeted version tags to malicious commits that dumped runner secrets into workflow logs.

Prevention, especially pinning to full commit SHAs, is covered in How to Pin GitHub Actions to Commit SHAs. For compromises of your own pipeline infrastructure rather than a dependency, use the CI/CD Pipeline Compromise Playbook.

How to use this template

  • Copy the sections into your incident response platform or wiki and replace every item in square brackets, such as [security on-call], with your own names, channels and tools.
  • Pre-build the queries in section 3 now. During an incident you will not have time to learn your code search or audit log syntax.
  • Keep the credential inventory referenced in section 5 current. The speed of this response depends almost entirely on knowing which secrets each repository can reach and who owns them.
  • Run a tabletop exercise against this template at least once a year, using one of the 2025 incidents as the scenario.
  • Timings given as targets, such as "within 4 hours", are NHI Mgmt Group suggestions. Set your own based on exposure: public repositories with public logs need the fastest response.

Why tag hijacks are different

GitHub's secure use reference for Actions notes that tags can be moved or deleted if an attacker gains access to an action's repository, and that a compromised action can access all repository secrets and may use the GITHUB_TOKEN to write to the repository. A tag hijack therefore turns one stolen maintainer credential into code execution in every downstream workflow that references the tag, with no change to those workflows. The 2025 incidents showed two further properties that shape this playbook:

  • Exposure through logs. According to GitHub advisory GHSA-mrrh-fwg8-r2c3, the malicious tj-actions/changed-files code downloaded a script that scanned the runner worker process memory for secrets, base64-encoded them and printed them to workflow logs. In repositories with public logs, anyone could read them.
  • Transitive compromise. According to advisory GHSA-qmg3-hpqr-gqvc, several other reviewdog actions that used reviewdog/action-setup@v1 internally were compromised regardless of version or pinning method. Pinning the outer action does not protect you if it calls another action by tag.

CISA added both to its Known Exploited Vulnerabilities catalogue: CVE-2025-30066 (tj-actions/changed-files) on 18 March 2025 and CVE-2025-30154 (reviewdog/action-setup) on 24 March 2025. Our breach analyses cover the chain in detail: SpotBugs Token Leak 2025, reviewdog/action-setup Compromise 2025 and tj-actions/changed-files Compromise 2025.

1. Scope and triggers

In scope: compromise, takeover or malicious release of any GitHub Action, reusable workflow or composite action not owned by [organisation] that is referenced by workflows in [GitHub organisations and enterprise]. This includes actions pulled in transitively by other actions.

Out of scope: compromise of [organisation]'s own actions, runners or GitHub accounts (use the CI/CD Pipeline Compromise Playbook), and vulnerable but not malicious actions handled through normal vulnerability management.

Triggers. Open an incident when any of these occur:

  • A GitHub security advisory, CISA KEV entry or vendor disclosure names an action used in [organisation].
  • A credible public report (maintainer issue, security research publication) describes malicious code or retargeted tags in an action you use.
  • Runner egress monitoring flags an unexpected outbound connection from a step running a third-party action.
  • Secret scanning or log review finds encoded or plain secrets in workflow logs produced by a third-party step.
  • Dependabot or a dependency review alert flags a malicious action version.

Severity guide:

SeverityConditionInitial response target
CriticalAffected action ran in any public repository, or in any workflow with production cloud credentials, during the windowIncident lead assigned within 30 minutes; containment within 4 hours
HighAffected action ran in private repositories with access to secrets during the windowIncident lead within 1 hour; containment within 8 hours
MediumAction referenced but did not run during the window, or ran only without secretsSame business day

2. Roles and contacts

RoleResponsibilityNamed owner
Incident leadOwns the timeline, decisions and status updates[security on-call]
GitHub platform ownerOrganisation and enterprise policy changes, audit log and code search queries, workflow disablement[platform engineering lead]
Secrets and NHI ownerCredential inventory, rotation coordination, revocation evidence[IAM or secrets platform lead]
Cloud ownersReview and revoke cloud credentials and OIDC trust used by affected workflows[AWS, Azure, GCP account owners]
Repository ownersConfirm workflow use, apply fixes, validate builds[CODEOWNERS for each affected repository]
Detection engineeringHunt for use of exposed credentials[SOC lead]
Communications and legalCustomer, partner and regulator notification decisions[communications lead], [legal counsel]

Record the incident channel [channel name], the bridge line [bridge] and the evidence store [location] here. Agree in advance that the incident lead may disable workflows and block actions across the organisation without further approval.

3. Detection and triage

The goal of triage is a list of every workflow run that executed the compromised code, and the secrets each could reach.

3.1 Establish the facts

  • Affected action or actions, including any that call it internally. For reviewdog, the advisory lists action-shellcheck, action-composite-template, action-staticcheck, action-ast-grep and action-typos alongside action-setup.
  • Exposure window in UTC. The reviewdog advisory gives 11 March 2025, 18:42 to 20:31 UTC; the tj-actions advisory gives 14 to 15 March 2025.
  • Malicious commit SHAs and the tags pointed at them. The tj-actions advisory lists commit 0e58ed8671d6b60d0890c21b07f8835ace038e67 and notes that tags were retroactively repointed to it.
  • Behaviour: what was exfiltrated and where (logs, outbound network, repository writes).
  • Fixed or safe version, if any. The tj-actions advisory lists 46.0.1 as patched; the reviewdog advisory lists no patched version.

3.2 Find every reference

  • Run organisation-wide code search for the action name in .github/workflows and in action.yml files of your own composite actions: [saved query].
  • Check the dependency graph or SBOM export for the action, including transitive references.
  • Do not forget forks, archived repositories with scheduled workflows, and repositories in other organisations under the enterprise.

3.3 Find every run in the window

  • List workflow runs in the exposure window for each referencing workflow using the REST API or [audit tooling]. Record repository, workflow, run ID, trigger, branch and visibility.
  • For each run, preserve the log before anything else: export it to the evidence store. GitHub's guidance for an unredacted secret in a log is to delete the log and rotate the secret, so preservation must happen first, under access control.
  • Inspect the affected step output. The tj-actions advisory describes the leaked data as double base64-encoded; decode suspicious output in an isolated environment only, and never paste it into shared tools.

3.4 Map exposed credentials

For each run, list everything the runner process could access: repository, environment and organisation secrets available to the job; the GITHUB_TOKEN and its permissions; cloud credentials obtained through OIDC federation; and any credentials on self-hosted runners. GitHub warns that redaction only applies to secrets used in that job and that transformed versions of secrets (Base64, URL-encoded, generated JWTs) need registering separately, so do not assume the masked log shows the full picture.

Output of triage: an exposure register with columns run ID, repository, visibility, secret name, secret type, owner, system it unlocks, and rotation status.

4. Containment

Containment stops further exposure. Do it in parallel with triage, not after it.

  1. Block the action organisation-wide. In the Actions policy, use the allowed actions list with a block entry. GitHub's organisation Actions policy documentation gives the syntax: prefix an entry with ! to block it, for example *, !owner/action@* to allow everything else while blocking one action. Apply at enterprise level if you have one.
  2. Block transitive callers too. Add every action known to call the compromised one.
  3. Disable affected workflows that cannot be fixed immediately, particularly scheduled and pull_request_target workflows that run without human action.
  4. Restrict log access. For public repositories, preserve then delete logs of affected runs to stop further reading of exposed secrets. For private repositories, limit who can read logs while rotation is under way.
  5. Isolate self-hosted runners that ran the action. GitHub notes self-hosted runners can be persistently compromised by untrusted code; take them out of the pool and rebuild rather than clean.
  6. Freeze releases built by affected workflows during the window until their integrity is confirmed.

5. Eradication: rotate and revoke

Every credential in the exposure register for a Critical or High run is treated as compromised. Rotation is the core of this playbook.

  1. Prioritise by blast radius: production cloud credentials and deployment keys first, then package registry and code signing tokens, then third-party SaaS API keys, then everything else. Public repository exposure goes to the top regardless of type.
  2. Rotate, do not only revoke. Issue a new credential, update the secret store and the GitHub secret, confirm the workload works, then revoke the old one. Record the revocation time for each.
  3. Personal access tokens and GitHub App keys found in secrets: revoke and replace. Prefer moving to GitHub Apps with installation tokens or OIDC federation during the rebuild. See GitHub Apps vs Personal Access Tokens vs OAuth Apps.
  4. Cloud OIDC trust. Federated tokens are short-lived, but review what an attacker could have done with them during the window and check trust policies are scoped to specific repositories, branches and environments. See our GitHub Actions OIDC Federation Hardening Guide.
  5. GITHUB_TOKEN. It expires when the job ends, but check the repository for writes made by it during the window: new commits, tags, releases, workflow file changes and branch protection changes.
  6. Remove unused secrets discovered during triage rather than rotating them.
  7. Replace the action reference. Move to a known-good full commit SHA verified to come from the action's own repository, a fixed version, an internal fork you control, or remove the dependency.

Track rotation status in the exposure register and report the percentage complete to the incident lead at each update. Our Secrets Rotation Runbook Template has per-credential steps.

6. Recovery

6.1 Hunt for use of exposed credentials

  • Search cloud audit logs (CloudTrail, Azure Activity and sign-in logs, GCP Audit Logs) for each exposed credential from the start of the window to its revocation time, focusing on source IP addresses outside your runner ranges.
  • Review the GitHub audit log for token use from unfamiliar addresses, new deploy keys, new webhooks, new OAuth or GitHub App authorisations and changes to Actions policy.
  • Check package registries for versions published during or after the window that your pipeline did not produce.
  • Check third-party SaaS admin logs for API activity by exposed keys.

6.2 Restore service safely

  • Re-enable workflows only after their action references are replaced and their secrets rotated.
  • Rebuild and re-sign any release artefact produced by an affected run, and notify downstream consumers if a suspect artefact was published.
  • Keep the organisation block entry in place until the action's maintainers have published a clean, verified release and you have reviewed it.

6.3 Close criteria

  • All Critical and High exposure register rows rotated and old credentials revoked.
  • No evidence of credential misuse, or any misuse handled as a separate incident.
  • All references to the compromised action removed or replaced with a verified SHA.
  • Logs preserved in the evidence store and deleted from public repositories.

7. Communication and notification

  • Internal: status updates every [4] hours to [engineering leadership channel] during containment and rotation, then daily. Include run count, repositories, rotation percentage and any misuse found.
  • Developers: a short notice telling repository owners which workflows were blocked, why, and what they need to do. Ask them not to re-run affected workflows.
  • Customers and partners: if exposed credentials unlocked customer data or shared systems, or if a published artefact may be affected, [legal counsel] decides on notification under contracts and applicable law.
  • Upstream: report additional findings to the action's maintainers and to GitHub through the advisory process, sharing indicators responsibly.

8. Post-incident review

Hold the review within [10] working days. Questions to answer:

  • How long from public disclosure to our incident declaration, to organisation-wide block, and to full rotation?
  • Was the action pinned to a full commit SHA? If yes, did it call another action by tag?
  • Which secrets were reachable by the affected jobs, and how many of them were needed?
  • Were GITHUB_TOKEN permissions at read-only by default?
  • Did we have egress monitoring on runners, and would it have caught the behaviour?
  • Was the credential inventory accurate, and did every secret have an owner?

Feed actions into the hardening backlog in the next section and update this template.

Implementation guidance

These controls reduce the chance and impact of the next action compromise. Most come from GitHub's secure use reference.

  • Lock or pin dependencies. GitHub's reference describes a dependency lockfile, which records the exact commit for each action including transitive dependencies, as the strongest protection available, superseding SHA pinning for repositories that adopt it. Where lockfiles are not in use, pin every third-party action to a full-length commit SHA from the action's own repository, not a fork.
  • Enforce pinning by policy. Enable "Require actions to be pinned to a full-length commit SHA" in organisation or enterprise policy.
  • Allow-list actions. Use "Allow or block specified actions and reusable workflows" so that only reviewed actions can run.
  • Keep pins current. Use Dependabot version updates for actions so that SHA pins do not go stale, and review each update.
  • Least privilege tokens. Set the default GITHUB_TOKEN permission to read-only for contents and grant more per job.
  • Scope secrets narrowly. Use environment secrets with protection rules for deployment credentials, so that lint and test jobs running third-party actions never see them.
  • Prefer federation over stored secrets. Use OIDC to cloud providers so that no long-lived cloud key sits in GitHub.
  • Monitor runner egress. Alert on outbound connections from runners to unexpected hosts.
  • Review action source. Before adoption, check that the action does not send secrets to unexpected hosts or log them, as GitHub recommends, and score candidates with OpenSSF Scorecard.
  • Keep an NHI inventory mapping every Actions secret to an owner, a system and a rotation procedure.

Standards and references

Related NHI Mgmt Group resources: How to Pin GitHub Actions to Commit SHAs · GitHub and GitHub Actions Security Guide · CI/CD Pipeline Compromise Playbook · Secrets Rotation Runbook Template

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.