Security rules

NGB093: Third-party action not pinned to a commit

Reports uses: references in GitHub Actions workflows (steps and reusable-workflow jobs) to third-party actions that are not pinned to a full 40-character commit SHA, and docker:// images referenced by tag instead of digest..

Property Value
Rule ID NGB093
Category Supply chain
Default severity medium
CWE CWE-829, CWE-494
Built-in presets recommended: error, strict: error

Confidence is reported per finding (high, medium, low) and is independent of severity. See Reading findings.

What it checks

Reports uses: references in GitHub Actions workflows (steps and reusable-workflow jobs) to third-party actions that are not pinned to a full 40-character commit SHA, and docker:// images referenced by tag instead of digest.

Why it matters

Git tags and branches are mutable: whoever controls the action repository — its maintainer or an attacker who compromised it — can point v1 at new code, which then runs in your workflow with your secrets and token. This is how the tj-actions/changed-files compromise (2025) leaked CI secrets from thousands of repositories. A commit SHA cannot be moved.

Detection behavior and supported patterns

  • uses: owner/repo@v1 / @v1.2.3 (medium), @main / @master / no @ref (high)
  • uses: owner/repo/.github/workflows/x.yml@v1 reusable workflows
  • uses: docker://image:tag without @sha256: digest (low)
  • Not reported: full commit SHAs, local actions (./…), GitHub-owned actions/* and github/* (maintained by the platform that already runs the workflow; pin them too if your policy requires it)

Example

TypeScript
- uses: tj-actions/changed-files@v45

Safer alternative

TypeScript
- uses: tj-actions/changed-files@a284dc1814e3fd07f2e34267fc8f81227ed29fb8 # v45.0.7

Remediation

Pin every third-party action to a full commit SHA and keep the version in a comment (uses: owner/action@<40-hex sha> # v4.1.0); let Dependabot or Renovate update the pins. Reference container images by digest.

False-positive considerations

  • Actions owned by your own organization are reported; pin them or accept the risk with an exception.

Known limitations

  • Actions referenced inside composite actions or called reusable workflows are not followed.
  • A SHA pin does not prove the commit is reviewed or belongs to the upstream repository (fork commits are reachable too); keep pins updated with Dependabot / Renovate.

References

Run it

Shell
ngbastion explain NGB093