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:
GitHub Actions step uses mutable version tag
v4.5.1instead of a commit SHA, allowing the action owner to silently inject malicious code that could steal your repository secrets.More details about this
The
docker/login-actionstep is pinned to a mutable version tag (v4.5.1) instead of a specific commit SHA. This means the action maintainers can silently update the code at this tag without your knowledge.Here's how an attacker could exploit this:
docker/login-actionrepository (e.g., through credential theft or social engineering).v4.5.1tag to include malicious logic—for example, exfiltrating the${{ secrets.QUAY_ROBOT_TOKEN }}secret to an attacker-controlled server.QUAY_ROBOT_TOKEN, the attacker can push malicious container images to yourquay.io/wire/poll-appregistry, compromising all deployments.This attack pattern was used in real supply-chain compromises like trivy-action and kics-github-action. Version tags and branch names are mutable and can be repointed at any time by the action owner or a compromised maintainer.
To resolve this comment:
✨ Commit fix suggestion
View step-by-step instructions
Replace the mutable action reference with a full 40-character commit SHA in the
usesline for the login step.Change
uses: docker/login-action@v4.5.1touses: docker/login-action@<full-40-character-commit-sha>.Keep the same action and version when choosing the SHA by using the commit that corresponds to the
v4.5.1release from thedocker/login-actionrepository.This makes the workflow use an immutable revision instead of a tag that can be moved later.
Update the step so it still looks like
uses: docker/login-action@0123456789abcdef0123456789abcdef01234567, replacing the example SHA with the real 40-character commit for that release.Manually verify that the workflow can still authenticate to Quay.io and that the login step still receives
registry,username, andpasswordexactly as before.Alternatively, if you need an immediate temporary fix and already trust a newer release, pin directly to that release’s full commit SHA instead of
v4.5.1, but still avoid any tag such as@v4or@v4.5.1.💬 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.