Repository navigation
Security: pin GitHub Actions in release and CI workflows to commit SHAs - #7
Open
pimfeltkamp wants to merge 1 commit into
Open
pimfeltkamp wants to merge 1 commit into
pimfeltkamp wants to merge 1 commit into
Conversation
release.yml runs with id-token: write (RubyGems trusted publishing) and contents: write, but referenced actions/checkout, ruby/setup-ruby, rubygems/configure-rubygems-credentials and softprops/action-gh-release by mutable tag. A retagged or compromised upstream action would execute inside the job that can mint the gem-publishing OIDC token. Pin each action to the full commit SHA its tag currently resolves to, with a version comment so Dependabot (github-actions ecosystem) keeps bumping them. ci.yml uses the same two actions and shares the bundler cache with release runs, so it is pinned to the identical SHAs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
pimfeltkamp
commented
Nov 3, 2026
pimfeltkamp
left a comment
Contributor
Author
There was a problem hiding this comment.
✅ Automated review passed — no issues found. (Would approve, but the reviewer account authored this PR and GitHub forbids self-approval.)
✅ Safe to merge
This branch has not been deployed
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.
What was vulnerable
.github/workflows/release.ymlgrantsid-token: write(RubyGems trusted-publishing OIDC) andcontents: write, yet referenced four third-party actions by mutable tag:actions/checkout@v6,ruby/setup-ruby@v1,rubygems/configure-rubygems-credentials@v1.0.0andsoftprops/action-gh-release@v3. Tags can be moved or an upstream repository compromised, in which case the replaced action code runs inside the job that can mint the gem-publishing OIDC token and could push a maliciouscryptohoppergem. Verified by reading the workflow: all fouruses:entries were tag references.What the fix does
Pins every action to the full commit SHA its tag resolves to today, with a version comment so the existing Dependabot
github-actionsconfig keeps bumping both SHA and comment together:d23441a4v6points at)de492cf3v1branch)bc6dd217efb35369v3tag dereferenced)Each mapping was resolved via the GitHub API in this run and independently re-verified by a reviewer pass.
ci.ymluses the same two actions (checkout, setup-ruby) and shares thebundler-cachewith release runs on the same runner image and Ruby version, so it is pinned to the identical SHAs to close that lateral path.Why it is non-breaking
Every pinned commit is exactly the code the mutable tag currently resolves to, so the workflows run the same action code as before. No inputs, permissions or steps changed. Not breaking.
Tests
git diff --check: clean (no whitespace errors).uses:lines confirmed SHA-pinned by reading the files back with Node.yqare blocked in this unattended sandbox and Python has noyamlmodule. Only the ref token on each existing line changed, so structure is unaffected. CI on this PR will exerciseci.ymlfor real.Reviewer notes (not addressed here, out of scope)
Gemfile.lock, sobundle installin the release job resolves gem versions at release time while the OIDC token is available. Committing a lockfile or running tests in a separate job withoutid-tokenwould close that.configure-rubygems-credentialsv1.0.0 runs on Node 20; newer v2.x tags exist. Upgrading is a separate change.🤖 Automated security fix by claude-code-security. It is reviewed by the automated PR reviewer and auto-merged only if the review passes, CI is green, and the change is small and non-breaking.
🤖 Generated with Claude Code