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 September 7, 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 Is Not the Whole Supply-Chain Story

Pinning GitHub Actions to a commit hash is a sensible integrity step, but it addresses only one narrow failure mode: a later change to the referenced action repository. It does not validate the action’s original code, its transitive behaviour, or the trustworthiness of the workflow around it. Security teams often treat pinning as a complete supply-chain control when it is really one safeguard inside a broader review, monitoring, and response programme. For a control-oriented view of that broader programme, NIST’s control catalogue is useful as a reference point for governance, monitoring, and change discipline: NIST SP 800-53 Rev 5 Security and Privacy Controls. In practice, many teams discover the gap only after a pinned dependency is shown to be compromised through some other path, not after deliberate verification of the workflow itself.

How Pinning Works, and Where the Assumptions Break

Commit hash pinning makes a workflow reference immutable from the caller’s point of view. Instead of tracking a moving branch or tag, the workflow uses one exact revision, which prevents an action publisher from silently swapping in new code later. That is valuable because it reduces the chance that a benign action is replaced by a malicious update after approval. It also improves change review, because the team can see precisely which revision is in use.

That benefit is narrower than many teams assume. Pinning does not tell you whether the pinned revision was ever malicious, whether it contains a latent bug that leaks secrets, or whether the action itself fetches code, scripts, or dependencies at runtime. It also does not protect against workflow-level abuse such as overly broad permissions, unsafe secret exposure, or attacker-controlled inputs being passed into shell commands. Hash pinning therefore hardens one trust boundary, but it does not replace code review, provenance checks, permissions scoping, or runtime monitoring.

  • Pinning helps with change integrity, not with code trust by itself.
  • Review the action source and its release history before you freeze it into a workflow.
  • Assume any secrets reachable by the workflow can still be exposed if the workflow logic is unsafe.
  • Watch for actions that download additional content or execute network-fetched logic after startup.

The guidance breaks down when teams use pinning as a substitute for understanding what the workflow can do with credentials, build artifacts, and repository write access.

Where Teams Overstate the Protection, and What Still Needs Attention

Tighter pinning often increases confidence while leaving the rest of the pipeline unchanged, so teams must balance immutability against the operational risk of false reassurance. The common misunderstanding is to treat a fixed commit as proof of safety rather than proof of stability.

That distinction matters most in three edge cases. First, a pinned revision can still be unsafe if it was compromised before pinning or if it was never reviewed. Second, a pinned action can remain dangerous if it processes untrusted input, because the exploit path shifts from supply-chain mutation to workflow abuse. Third, pinning can create maintenance drag if teams stop updating at all; a frozen action may preserve a known good state while also preserving known vulnerabilities.

There is no consensus that pinning alone should be considered a sufficient approval gate. Most mature programmes treat it as one layer in a lifecycle that also includes publisher trust assessment, periodic revalidation, and detection for unexpected workflow behaviour. The real question is not whether the reference is immutable, but whether the action is still appropriate for the permissions and data it can reach.

Standards & Framework Alignment

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

MITRE ATT&CK address the attack and risk surface, while CIS Controls v8 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
CIS Controls v86 — Access Control ManagementPinned actions still need least-privilege workflow access and secret scoping.
16 — Application Software SecurityGitHub Actions are software supply-chain components that need review and lifecycle control.
Recommendation — Restrict workflow privileges so pinned actions cannot reach unnecessary secrets or write paths. Review third-party actions before pinning them and revalidate them on a defined schedule.
NIST CSF 2.0PR.DS — Data SecurityThe issue centers on whether workflows can expose or mishandle secrets and sensitive data.
DE.CM — Continuous MonitoringPinning does not remove the need to detect unexpected workflow behaviour or compromise.
Recommendation — Protect workflow data paths so pinned actions cannot leak secrets or sensitive build inputs. Monitor workflow execution for abnormal behavior, unexpected network calls, and secret access.
MITRE ATT&CKT1195 — Supply Chain CompromiseThe question is about supply-chain integrity of a GitHub Actions dependency.
Recommendation — Map action dependencies to supply-chain compromise paths and hunt for poisoned or hijacked revisions.

Practitioner Guidance

What to prioritise: Treat pinning as a baseline integrity control, then focus first on the permissions and secrets the workflow can reach. If an action can read tokens, write to repositories, or invoke deployment steps, the blast radius matters more than the hash format.

What to verify: Confirm that the pinned revision is the exact code you reviewed, that the workflow does not fetch additional executable content at runtime, and that any secret-bearing step is necessary for the job. If the review cannot explain how the action behaves with attacker-controlled input, the pin is not enough.

Common mistake: Teams often freeze the version and then stop watching for behavioural drift elsewhere in the workflow. The safer pattern is to pair pinning with periodic re-review, secret minimisation, and alerting on unusual job outputs, network access, or permission use.

Practitioner takeaway: A commit hash gives you immutability, not trust, so the control only becomes meaningful when teams manage workflow permissions, review execution paths, and keep a path to rapid replacement if the pinned revision proves unsafe.

Deepen Your Knowledge

Sign up to our weekly newsletter — get 33% off our NHI Foundation Level Course

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