-
Notifications
You must be signed in to change notification settings - Fork 23
chore(deps): bump actions/checkout from 6 to 7 #1238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ jobs: | |
| if: ${{ github.ref_type == 'tag' }} | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 0 # required by GoReleaser (https://goreleaser.com/ci/actions/#fetch-all-history) | ||
| - uses: actions/setup-go@v6 | ||
|
|
@@ -56,7 +56,7 @@ jobs: | |
| if: ${{ github.ref_type == 'tag' }} | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/checkout@v7 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🥳 Fixed in commit cd345ef 🥳 |
||
| with: | ||
| fetch-depth: 0 # required by GoReleaser (https://goreleaser.com/ci/actions/#fetch-all-history) | ||
| - uses: actions/setup-go@v6 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semgrep identified an issue in your code:
actions/checkout@v7is a mutable tag, so a repointed tag could run attacker-controlled code in your release jobs with repository write access.More details about this
actions/checkout@v7pulls whatever code thev7tag points to at runtime instead of a specific commit. In thisreleasesjob, that action runs before GoReleaser and has access to the checked-out repository plus the job’scontents: writepermission, so if thev7tag were ever repointed to attacker-controlled code, that code would execute during your release pipeline.A plausible attack looks like this:
actions/checkoutaction or gains the ability to move itsv7tag to a different commit.if: ${{ github.ref_type == 'tag' }}) and runs- uses: actions/checkout@v7in thereleasesjob.@v7to the attacker’s commit, and the malicious action code runs onubuntu-24.04inside your release job.actions/checkout, use the job’scontents: writepermission to alter release artifacts or create/update a GitHub release, and accessGITHUB_TOKENlater exposed to the GoReleaser step.actions/checkout@v7.The same risk also appears in the
releases-windowsjob, which uses the same mutableactions/checkout@v7reference before building Windows releases.To resolve this comment:
✨ Commit fix suggestion
View step-by-step instructions
actions/checkout@v7with a full 40-character commit SHA for the exact release you want to trust, for exampleactions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608.actions/checkout@v7step shown in this workflow so both checkout steps use the same pinned commit.with:block unchanged, so the step still usesfetch-depth: 0after pinning. Pinning to a commit SHA prevents the action owner from silently changing what code runs under the same tag name.actions/checkoutrelease than the example SHA, look up the commit behind that release on the action's GitHub releases page and pinuses:to that 40-character SHA instead of the version tag.💬 Ignore this finding
Reply with Semgrep commands to ignore this finding.
/fp <comment>for false positive/ar <comment>for acceptable risk/other <comment>for all other reasonsAlternatively, triage in Semgrep AppSec Platform to ignore the finding created by github-actions-mutable-action-tag.
You can view more details about this finding in the Semgrep AppSec Platform.