fix: Pin GitHub Actions to full SHA hashes#1
Merged
Desperado merged 1 commit intoQuality-Max:mainfrom Mar 26, 2026
Merged
Conversation
…tacks Replace mutable version tags (v4, v5) with immutable commit SHA references for all GitHub Actions used in CI workflow. Version tags are mutable and can be moved by the repository owner (or an attacker who compromises the repo), whereas commit SHAs are cryptographic and immutable.
Contributor
|
Great first contribution — a supply chain scanner should practice what it preaches. Thanks Hagen! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR replaces mutable version tags with immutable commit SHA references for all GitHub Actions used in the CI workflow.
Problem
The current workflow uses mutable version tags for GitHub Actions:
Version tags like
v4andv5are Git tags that can be moved at any time — by the repository owner, a maintainer with write access, or an attacker who gains access to the upstream repository. This is a well-documented supply chain attack vector:actions/checkoutrepository could move thev4tag to point to a malicious commit.@v4would silently execute the attacker's code on the next CI run.This is especially relevant for a supply chain security scanner — the tool designed to detect supply chain attacks should itself be hardened against them.
Fix
Pin all GitHub Actions to their full commit SHAs:
Commit SHAs are cryptographic hashes (SHA-1) of the exact commit content. They cannot be moved or tampered with without changing the hash, making them immutable references.
The version tag is preserved in a trailing comment (
# v4) for human readability and to simplify future version upgrades.OWASP Reference
How to Update
When upgrading to a new action version in the future, look up the commit SHA for the new tag:
gh api repos/actions/checkout/git/ref/tags/v5 --jq '.object.sha'