Skip to content

build(ci): pin GitHub Actions to commit SHAs - #3

Open
crypto-titan wants to merge 1 commit into
mainfrom
chore/pin-actions-to-sha
Open

build(ci): pin GitHub Actions to commit SHAs#3
crypto-titan wants to merge 1 commit into
mainfrom
chore/pin-actions-to-sha

Conversation

@crypto-titan

Copy link
Copy Markdown

Summary

Pins every uses: reference in .github/workflows/ to the commit SHA its current tag resolves to, with the version preserved as a trailing comment.

This is a supply-chain change only — no version bumps. Every SHA here is what @v4 / @v5 / @stable already pointed at, so the exact same code runs after this merge as before it.

Why

A tag is a mutable pointer owned by the action's maintainer. @v4 can be repointed at any time — by the maintainer, or by anyone who compromises their account. Every job here checks out our source and some hold release credentials, so "whatever @v4 means today" is an unreviewed dependency on ~10 external accounts staying uncompromised. A SHA cannot be repointed.

This is the mitigation for the class of attack behind tj-actions/changed-files (CVE-2025-30066), where a repointed tag exfiltrated secrets from tens of thousands of repos.

Notes specific to this repo

  • dtolnay/rust-toolchain@stable was a branch ref, not a tag — strictly worse than a version tag, since any push to that branch changed what ran. Now pinned. This freezes the action implementation, not the Rust version: the action shells out to rustup toolchain install at run time, so Rust stable still floats as before.
  • golangci/golangci-lint-action stays on v8 deliberately. v9 is available but requires golangci-lint v2 config format — that's a separate change.

What this does not do

Pinning freezes the code but doesn't review it. Upgrades now require an explicit SHA change, which is the point — but it also means security patches no longer arrive silently. Enabling Dependabot for github-actions is the intended follow-up; it parses the # v4 comment and raises PRs against these pins.

Test plan

  • CI green — the same action code runs, so a failure here would be unrelated to the pin
  • Confirm release-proof-helper.yml still builds the Rust helper

A mutable tag like @v4 is repointed by the action's maintainer, so a
compromised or coerced upstream account can change what runs inside our
jobs. Pinning to the commit SHA the tag resolves to today removes that
path without changing the code that executes.

No version bumps: every SHA here is what the existing ref already pointed
at, so this is a supply-chain change only. The trailing comment keeps the
human-readable version visible and gives Dependabot the anchor it needs to
propose future bumps.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant