Pin the workflow actions to full commit SHAs - #2467
Open
Totara-thib wants to merge 1 commit into
Open
Conversation
Version tags like docker/login-action@v4 are movable pointers. Anyone with push access to one of those action repos can retag and the next scheduled docker-base or docker run executes the new code with the DockerHub credentials in reach. A commit SHA cannot be moved after the fact. Dependabot understands these pins and keeps updating them, bumping the SHA and the version comment together, so the daily github-actions updates continue to work as before.
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.
Proposed Changes
A version tag like
docker/login-action@v4is a movable pointer. Anyone with push access to one of those action repos can retag, and the next run executes the new code. For this repo the exposed path is concrete:docker-base.ymlanddocker-demo.ymlrun on a schedule and log into DockerHub with the credentials in secrets, anddocker.ymlpushes the production images. A moved tag on any of the docker actions runs with those credentials in reach. This is not hypothetical, the tj-actions/changed-files incident (CVE-2025-30066) rewrote existing tags on a widely used action to leak CI secrets.A commit SHA cannot be moved after the fact. Each pinned line keeps the version as a comment, so every SHA can be cross-checked against the tag on the action's releases page.
Dependabot understands this format and your daily
github-actionsupdates keep working, it bumps the SHA and the comment together, the same flow as the recent setup-python bump (#2438). Nothing changes in how updates arrive.One heads-up: if the organization ever restricts allowed actions in the repo settings with tag patterns like
owner/action@v4, those patterns stop matching SHA refs and workflows fail at startup. The fix isowner/action@*in that setting. Nothing to do if no such restriction is configured.Related Issue(s)
None.
Please check that the PR fulfills these requirements
ruff format && isort .) (not applicable, no Python touched)CHANGELOG.md(not applicable, no feature and no deployment change)Found and fixed by Plumber's analysis, reviewed and submitted by me.