Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
if: ${{ github.ref_type == 'tag' }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

Copy link
Copy Markdown

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@v7 is 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@v7 pulls whatever code the v7 tag points to at runtime instead of a specific commit. In this releases job, that action runs before GoReleaser and has access to the checked-out repository plus the job’s contents: write permission, so if the v7 tag were ever repointed to attacker-controlled code, that code would execute during your release pipeline.

A plausible attack looks like this:

  1. An attacker compromises the actions/checkout action or gains the ability to move its v7 tag to a different commit.
  2. Your workflow starts on a tag push (if: ${{ github.ref_type == 'tag' }}) and runs - uses: actions/checkout@v7 in the releases job.
  3. GitHub resolves @v7 to the attacker’s commit, and the malicious action code runs on ubuntu-24.04 inside your release job.
  4. That code can read the repository contents fetched by actions/checkout, use the job’s contents: write permission to alter release artifacts or create/update a GitHub release, and access GITHUB_TOKEN later exposed to the GoReleaser step.
  5. The result is a supply-chain compromise where users download a release produced or modified by attacker-controlled code, even though your workflow file still says actions/checkout@v7.

The same risk also appears in the releases-windows job, which uses the same mutable actions/checkout@v7 reference before building Windows releases.

To resolve this comment:

✨ Commit fix suggestion

Suggested change
- uses: actions/checkout@v7
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
fetch-depth: 0 # required by GoReleaser (https://goreleaser.com/ci/actions/#fetch-all-history)
View step-by-step instructions
  1. Replace the mutable action reference actions/checkout@v7 with a full 40-character commit SHA for the exact release you want to trust, for example actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608.
  2. Apply the same change to the other actions/checkout@v7 step shown in this workflow so both checkout steps use the same pinned commit.
  3. Keep the existing with: block unchanged, so the step still uses fetch-depth: 0 after pinning. Pinning to a commit SHA prevents the action owner from silently changing what code runs under the same tag name.
  4. Alternatively, if you need a newer actions/checkout release than the example SHA, look up the commit behind that release on the action's GitHub releases page and pin uses: 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 reasons

Alternatively, 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.

with:
fetch-depth: 0 # required by GoReleaser (https://goreleaser.com/ci/actions/#fetch-all-history)
- uses: actions/setup-go@v6
Expand All @@ -56,7 +56,7 @@ jobs:
if: ${{ github.ref_type == 'tag' }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7

@semgrep-code-scalingo semgrep-code-scalingo Bot Jul 1, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608.

🥳 Fixed in commit cd345ef 🥳

with:
fetch-depth: 0 # required by GoReleaser (https://goreleaser.com/ci/actions/#fetch-all-history)
- uses: actions/setup-go@v6
Expand Down
Loading