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.
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/stale@v11uses a movable tag, so a repointed tag would run new code in this scheduled job with permission to modify issues and pull requests.More details about this
actions/staleis pulled with the mutable tag@v11, so this scheduled workflow will run whatever code theactions/stalemaintainers later pointv11to. Because this job runs every day and hasissues: writeandpull-requests: write, a repointed tag could automatically post attacker-controlled comments, add thestalelabel, or close issues and PRs in this repository.A plausible abuse path is: 1) an attacker compromises the
actions/stalerelease process or maintainer account foractions/stale; 2) they move thev11tag to a new commit containing malicious action code; 3) at the nextschedulerun, GitHub resolvesuses: actions/stale@v11to that attacker-chosen commit; 4) that code executes in thestalejob with this repository's token permissions; 5) it can then use those permissions to modify issue and PR state, for example mass-comment on sensitive threads, applystaleto active PRs, or close discussions to disrupt maintainers. The same risk applies on manualworkflow_dispatchruns, because the workflow always trusts the current target of@v11instead of a fixed commit.To resolve this comment:
✨ Commit fix suggestion
usesline with a full 40-character commit SHA for the sameactions/stalerelease.uses: actions/stale@v11touses: actions/stale@<full-40-character-commit-sha> # v11.actions/stalerelease or tag page and make sure it is the commit that backsv11. Pinning to a commit SHA prevents the action owner from silently changing what runs under the same tag name.Alternatively, if you need to stay on a specific patch release, pin to the full SHA for that exact release tag instead of the major tag, for example
# v11.x.y.💬 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.
🛟 Help? Slack #semgrep-help or go/semgrep-help.
Resolution Options:
/fp $reason(if security gap doesn’t exist)/ar $reason(if gap is valid but intentional; add mitigations/monitoring)/other $reason(e.g., test-only)You can view more details about this finding in the Semgrep AppSec Platform.