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
docker/login-action@v4.6.0tag can be silently repointed, causing the workflow to run attacker-controlled code with Quay credentials and potentially tamper with published images.More details about this
docker/login-action@v4.6.0uses a version tag rather than an immutable commit. Thedeploy-stagingjob runs this step on pushes tomainand passes${{ secrets.QUAY_USERNAME }}and${{ secrets.QUAY_ROBOT_TOKEN }}to the action. If thedocker/login-actionowner—or an account that compromises the repository—moves thev4.6.0tag, a later workflow run can execute attacker-controlled action code instead of the intended login implementation.A plausible attack would be:
v4.6.0to a malicious commit.main, triggeringdeploy-staging.docker/login-actionruns with the Quay credentials supplied throughusernameandpassword, then sendsQUAY_ROBOT_TOKENto an attacker-controlled endpoint or uses it to alter images inquay.io/wire/poll-app.Build and push, allowing the attacker to tamper with the image published bydocker/build-push-actionor use the stolen credentials outside this workflow.Because the reference can change without any workflow-file change, a previously reviewed workflow can begin executing different code on a future
mainpush.To resolve this comment:
✨ Commit fix suggestion
View step-by-step instructions
docker/login-actionrelease corresponding tov4.6.0:uses: docker/login-action@<40-character-commit-sha>.docker/login-actionrepository before using it. Do not use@v4,@v4.6.0, or a shortened SHA.registry,username, andpasswordinputs unchanged. A full commit SHA prevents the action code from changing if the tag is later moved.💬 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.