-
Notifications
You must be signed in to change notification settings - Fork 0
chore(deps): bump actions/setup-node from 6 to 7 #379
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ jobs: | |
| - uses: pnpm/action-setup@v5 | ||
| with: | ||
| version: 7.6.0 | ||
| - uses: actions/setup-node@v6 | ||
| - uses: actions/setup-node@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. Semgrep identified an issue in your code: The GitHub Actions step More details about thisThe Exploit scenario:
To resolve this comment: ✨ Commit fix suggestion
Alternatively, if you need to use a local action instead of a remote one, change the step to a local path such as 💬 Ignore this findingReply with Semgrep commands to ignore this finding.
Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by github-actions-mutable-action-tag. Need help? Review go/semgrep-playbook or Reach out in #security-vulnerabilities on Slack. You can view more details about this finding in the Semgrep AppSec Platform. |
||
| with: | ||
| node-version: '16' | ||
| cache: 'pnpm' | ||
|
|
||
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:
GitHub Actions step uses mutable tag
v7instead of a commit SHA, allowing the action owner to silently redirect to malicious code during workflow execution.More details about this
The
actions/setup-nodeaction is pinned to thev7tag, which is a mutable reference that can be silently repointed by the action owner to point to different commits without any warning.Here's how an attacker could exploit this:
Compromise the action repository: An attacker gains write access to the
actions/setup-noderepository (via stolen credentials, compromised maintainer account, etc.).Repoint the v7 tag: The attacker moves the
v7tag to a malicious commit they've created that injects backdoors into Node.js installations or steals environment secrets.Automatic deployment: When your GitHub Actions workflow runs on the next push to
main, it automatically uses the new malicious code pointed to byv7. Your CI/CD system then executes the backdoored Node.js setup and potentially exposesGITHUB_TOKENor other secrets to the attacker.Supply chain compromise: The attacker now has code execution within your repository's CI/CD context, allowing them to inject malicious code into your published packages or steal sensitive data.
This is exactly how the
trivy-actionandkics-github-actioncompromises occurred in real incidents. Using a specific 40-character commit SHA (immutable) instead ofv7(mutable) prevents this attack.To resolve this comment:
✨ Commit fix suggestion
actions/setup-node@v7with a full 40-character commit SHA for the exact action version you intend to use, for exampleuses: actions/setup-node@<full-commit-sha>.with:settings unchanged under that step, includingnode-version: '16'andcache: 'pnpm'.actions/setup-noderelease that matches the version you want, rather than using a tag or branch name. Pinning to a commit SHA prevents the referenced code from changing without an explicit workflow update.uses:entries in the same workflow the same way, becauseactions/checkout@v6,pnpm/action-setup@v5, andcycjimmy/semantic-release-action@v5are also tag-based references and should be changed to full commit SHAs.💬 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.
Need help? Review go/semgrep-playbook or Reach out in #security-vulnerabilities on Slack.
You can view more details about this finding in the Semgrep AppSec Platform.