Repository navigation
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 repointingv11could make this scheduled job run attacker-controlled code with issue and PR write access.More details about this
actions/stale@v11is referenced by a movable tag, not an immutable commit. If thev11tag is ever repointed, this scheduled workflow would start running different code every day withissues: writeandpull-requests: writepermissions.A plausible attack looks like this:
actions/staleaction or gains permission to retagv11.v11to a malicious commit while keeping the sameuses: actions/stale@v11line in your workflow.cron: '0 0 * * *') or manual run (workflow_dispatch), GitHub fetches that new code because the workflow trusts thev11tag name.stalejob with write access toissuesandpull-requests.Because the reference is mutable, the behavior of this job can change without any change in your repository.
To resolve this comment:
✨ Commit fix suggestion
Replace the mutable tag in the workflow step with a full 40-character commit SHA so the action cannot change without an explicit update.
Change
uses: actions/stale@v11touses: actions/stale@<full-40-char-commit-sha> # v11.Resolve the SHA from the
actions/stalerepository by opening thev11release or tag in GitHub and copying the commit hash thatv11currently points to.Use that exact commit in the
uses:line, for exampleuses: actions/stale@0123456789abcdef0123456789abcdef01234567 # v11.Keep the
# v11comment after the SHA so the pinned version is still easy to recognize during future updates.Alternatively, if you need automated dependency updates for GitHub Actions, enable a tool such as Dependabot for
github-actionsso it can open PRs whenactions/stalepublishes a newer trusted SHA.💬 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.