Join our Newsletter — 33% off our NHI Course
Home› FAQ› Cyber Security› What do security teams get wrong about pinning…
Cyber Security

What do security teams get wrong about pinning GitHub Actions to commit hashes?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated October 31, 2026 Domain: Cyber Security

Pinning is useful, but many teams overestimate what it solves. It only blocks future malicious updates to that action version. It does not stop pre-existing malicious code, attacks through other software channels, or secret leakage from already exposed workflows. A stronger programme combines verification, monitoring, and rapid response across the supply chain.

Why commit-hash pinning helps, and what it cannot prove

Pinning a GitHub Action to a commit hash is a supply-chain integrity control, not a guarantee that the action is safe. It freezes the referenced code so a later tag move or release swap cannot silently change what your workflow runs. That matters, but it only narrows one attack path. It does not validate the action’s original content, its dependencies, or the trustworthiness of the workflow around it.

That is why teams often overread the control. If the pinned commit already contains malicious logic, pinning preserves that exact logic. If the workflow itself leaks secrets, invokes unsafe scripts, or passes overly broad tokens, the pin does nothing to stop the abuse. A useful baseline is to review pinned actions as GitHub and GitHub Actions Security Guide recommends, then treat the pin as one input into trust, not the trust decision itself.

In practice, pinning is strongest when it sits alongside permission scoping, review of workflow triggers, and a plan to detect unexpected behaviour in the pipeline. Without those, the pin can create a false sense of safety because the action version looks stable even when the workflow remains exploitable.

Where teams miss the real exposure in GitHub Actions workflows

The biggest mistake is assuming the main risk is only future upstream tampering. The more common exposure is that the workflow already has enough privilege or secret access to be abused even when the action version never changes. A pinned action can still read repository secrets, write artifacts, call external services, or run in a context that exposes credentials to downstream steps. CI/CD Pipeline Identity Security Guide is useful here because the control problem is broader than version pinning, it is about who and what the pipeline is allowed to act as.

Teams also underestimate dependency chains. A pinned action may be safe at the commit you selected, but the workflow can still be compromised through another maintained action, a malicious pull request path, artifact poisoning, cache abuse, or a compromised runner. In other words, pinning one reference does not remove the need to secure the rest of the execution environment.

Another blind spot is secrets leakage from already exposed workflows. If a workflow is vulnerable to logging secrets, persisting credentials to artifacts, or printing environment data during failure handling, the attacker does not need a future action update. They only need one run. Incidents such as ArtiPACKED 2024 show why artifact handling and token scope matter as much as the action reference itself.

How to treat pinned actions as one control in a wider assurance program

Use pinning to reduce update risk, then layer it with controls that address provenance, runtime exposure, and response. The right question is not “is it pinned?” but “what can this workflow still do if the pinned code is perfect, stale, or already hostile?” That includes token minimisation, workflow review, artifact scrutiny, and the ability to revoke or rotate credentials quickly if a workflow is later found to be abused.

For GitHub-specific supply-chain scenarios, direct evidence from past compromises matters because it shows how attackers move from one foothold to another. Examples such as GhostAction campaign 2025 and tj-actions/changed-files compromise 2025 show that workflow compromise often turns into secret exposure, not just code replacement. That is why verification and monitoring need to cover the workflow, the runner, and the downstream credentials together.

When a team needs a structured response path, it should be ready to disable affected workflows, inspect execution history, review token usage, and rebuild from a known-good state rather than trusting the pinned commit alone. The CI/CD Pipeline Compromise Playbook is a good operational reference for that recovery posture.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 addresses the attack and risk surface, while SLSA, CIS Controls v8 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
SLSABuild provenance and integrityGitHub Actions pinning is part of software supply-chain integrity and provenance.
Recommendation — Verify workflow provenance and restrict trust to reviewed, immutable references.
CIS Controls v8CIS-5 — Account ManagementWorkflow tokens and secret exposure make account and credential control central to the risk.
Recommendation — Minimise workflow access and rotate exposed credentials quickly.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementPinned workflows still expose credentials that must be managed, rotated, and revoked.
Recommendation — Control credential lifecycle for pipeline identities and revoke exposed secrets promptly.
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageGitHub Actions compromises often leak workflow secrets even when code is pinned.
NHI-07 — Long-Lived SecretsPinned actions can still abuse durable tokens already available in the workflow.
Recommendation — Audit workflows for secret leakage paths and remove long-lived credentials. Replace long-lived workflow secrets with short-lived credentials and tight scope.

Practitioner Guidance

What to prioritise: Prioritise workflows that can reach secrets, publish artifacts, or modify downstream systems. A pinned action in a low-privilege job is not the same risk as a pinned action in a release or deployment path.

What to verify: Verify the full workflow context before trusting the pin, including trigger conditions, token permissions, artifact handling, and whether the action is called from a path that can be influenced by untrusted input.

Decision rule: If the workflow can expose production credentials, treat pinning as necessary but insufficient and require review, monitoring, and a rapid rollback or rotation path. If the workflow has no sensitive reach, the operational urgency is lower, but the control still needs periodic revalidation.

Practitioner takeaway: Commit-hash pinning reduces supply-chain drift, but it does not neutralise a workflow that is already over-privileged, leaky, or reachable through another abuse path.

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.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 31, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org