build(deps): bump actions/setup-node from 6.4.0 to 7.0.0#2361
build(deps): bump actions/setup-node from 6.4.0 to 7.0.0#2361dependabot[bot] wants to merge 1 commit into
Conversation
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.4.0 to 7.0.0. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@v6.4.0...v7.0.0) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
| - name: set up node | ||
| if: steps.download.outputs.found == 'true' | ||
| uses: actions/setup-node@v6.4.0 | ||
| uses: actions/setup-node@v7.0.0 |
There was a problem hiding this comment.
Semgrep identified an issue in your code:
GitHub Actions step actions/setup-node@v7.0.0 uses a mutable tag that could be repointed by a malicious actor to inject backdoored code into your build and deployment pipeline.
More details about this
The actions/setup-node@v7.0.0 step uses a mutable semantic version tag (v7.0.0) instead of a pinned commit SHA. Since v7.0.0 is just a tag, the maintainer of actions/setup-node can repoint it to a different commit at any time without warning.
Exploit scenario:
- An attacker compromises the GitHub account of the
actions/setup-nodemaintainer or gains write access to their repository. - The attacker moves the
v7.0.0tag to point to a malicious commit that contains backdoored Node.js setup logic. - Your workflow runs and executes
uses: actions/setup-node@v7.0.0, which now silently pulls the attacker's malicious commit. - The malicious action exfiltrates your
id-token(which you explicitly granted write permission to viapermissions: id-token: write), allowing the attacker to assume your repository's identity and publish compromised packages to npm or modify your release. - Your npm package gets published with backdoored code, affecting all downstream users who install it.
This mirrors real attacks like the 2023 compromises of trivy-action and kics-github-action.
To resolve this comment:
✨ Commit fix suggestion
| uses: actions/setup-node@v7.0.0 | |
| uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v7.0.0 |
View step-by-step instructions
-
Replace the mutable action reference with a full 40-character commit SHA in the matched step.
Changeuses: actions/setup-node@v7.0.0touses: actions/setup-node@<full-commit-sha> # v7.0.0. -
Pin the SHA to the exact commit for the
v7.0.0release from the action’s GitHub repository, not a short SHA and not the tag alone.
This prevents the action from changing if the tag is later moved. -
Keep the version as an inline comment after the SHA, such as
# v7.0.0, so the pinned release is still easy to track during future updates. -
If this workflow also uses other third-party actions with tag-based references in nearby steps, pin those the same way, for example
uses: actions/checkout@<full-commit-sha> # v7.0.0.
Alternatively, if you need to update to a newer action release, pin that newer release’s commit SHA instead of using a version tag like @v7.0.0 directly.
💬 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.
|
|
||
| - name: Setup Node for npm publish | ||
| uses: actions/setup-node@v6.4.0 | ||
| uses: actions/setup-node@v7.0.0 |
There was a problem hiding this comment.
Semgrep identified an issue in your code:
GitHub Actions step uses mutable version tag v7.0.0, allowing the action maintainer to silently redirect the tag to malicious code.
More details about this
The GitHub Actions step references actions/setup-node@v7.0.0, which uses a semantic version tag. Version tags like v7.0.0 can be silently repointed by the action maintainer at any time, meaning an attacker who compromises the actions/setup-node repository could move the v7.0.0 tag to point to a malicious commit.
Here's how this attack would work:
- An attacker gains access to the
actions/setup-noderepository (through compromised credentials or social engineering) - The attacker modifies the commit at the
v7.0.0tag to inject malicious code—for example, code that exfiltrates${{ secrets.GITHUB_TOKEN }}or environment variables - Your workflow runs and executes
uses: actions/setup-node@v7.0.0, which now runs the attacker's malicious code - The attacker can access your repository secrets, modify your code, or compromise your build artifacts
- You don't notice because the tag name appears unchanged—it's just silently pointing to the compromised commit
This is a real threat: the trivy-action and kics-github-action projects were both compromised this way. The tag you're using should be pinned to a specific 40-character commit SHA (like actions/setup-node@8ade135a41bc03ea155e62e844d188df1ea18608) so the exact code executed is immutable and controlled by you, not the maintainer.
To resolve this comment:
✨ Commit fix suggestion
| uses: actions/setup-node@v7.0.0 | |
| uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v7.0.0 |
View step-by-step instructions
-
Replace the mutable version tag in the
usesline with the full 40-character commit SHA for the sameactions/setup-noderelease.
Changeuses: actions/setup-node@v7.0.0touses: actions/setup-node@<40-character-commit-sha> # v7.0.0. -
Keep the version as an inline comment after the SHA so future updates are easier to track, for example
uses: actions/setup-node@<sha> # v7.0.0. -
Get the correct SHA from the
actions/setup-noderelease or commit page, and make sure the value after@is exactly 40 lowercase hex characters. Pinning to a commit SHA prevents the action owner from silently moving the referenced version to different code.
Alternatively, if you need to stay on a newer action release, update to that release first and then pin that exact release’s commit SHA instead of using the tag directly.
💬 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.
Bumps actions/setup-node from 6.4.0 to 7.0.0.
Release notes
Sourced from actions/setup-node's releases.
Commits
8207627Migrate to ESM and upgrade dependencies (#1574)04be95cAdd cache-primary-key and cache-matched-key as outputs (#1577)7c2c68ddocs: Update caching recommendations to mitigate cache poisoning risks (#1567)6a61c03Merge pull request #1569 from jasongin/update-actions-cache-5.1.030eb73bResolve high-severity audit issues4e1a87aUpdate dist360237fStrict equality4f8aac5Bump@actions/cacheto 5.1.0, log cache write deniedf4a67bbOnly usemirrorTokeningetManifestif it's provided (#1548)0355742Remove dummy NODE_AUTH_TOKEN export (#1558)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)