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:
The build runs
actions/setup-javafrom the mutablev6.0.0tag. If that tag is repointed, a future pull-request workflow can execute attacker-controlled code with access to the runner and any available workflow credentials.More details about this
actions/setup-java@v6.0.0selects a mutable release tag rather than an immutable commit. The action owner can movev6.0.0to a different commit without changing this workflow, so a future run could execute attacker-controlled code before./gradlew ktlintCheck,./gradlew detekt, and./gradlew build --inforun.A plausible attack is:
actions/setup-javarelease process or gains control of thev6.0.0tag.v6.0.0to code that runs during theactions/setup-javastep and reads the checkout, environment, and available GitHub Actions credentials.Buildworkflow runs for a pull request, the malicious step can alter files or Gradle configuration before the./gradlewcommands execute, capture accessibleGITHUB_TOKENor repository secrets, and send them to an attacker-controlled server.actions/checkout@v7andactions/upload-artifact@v7, creating additional moving trust dependencies.To resolve this comment:
✨ Commit fix suggestion
View step-by-step instructions
v6.0.0reference with the full 40-character commit SHA that corresponds to theactions/setup-javav6.0.0 release:uses: actions/setup-java@<40-character-commit-SHA>.withconfiguration unchanged. A commit SHA cannot be silently moved to different code, unlike a version tag or branch name.actions/checkoutandactions/upload-artifact, if they are also not pinned to full 40-character 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.
You can view more details about this finding in the Semgrep AppSec Platform.