Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: docker/setup-buildx-action@v4

- name: Login to Quay.io
uses: docker/login-action@v4.5.1
uses: docker/login-action@v4.6.0

Copy link
Copy Markdown

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.0 tag 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.0 uses a version tag rather than an immutable commit. The deploy-staging job runs this step on pushes to main and passes ${{ secrets.QUAY_USERNAME }} and ${{ secrets.QUAY_ROBOT_TOKEN }} to the action. If the docker/login-action owner—or an account that compromises the repository—moves the v4.6.0 tag, a later workflow run can execute attacker-controlled action code instead of the intended login implementation.

A plausible attack would be:

  1. The attacker repoints v4.6.0 to a malicious commit.
  2. A developer pushes to main, triggering deploy-staging.
  3. The malicious docker/login-action runs with the Quay credentials supplied through username and password, then sends QUAY_ROBOT_TOKEN to an attacker-controlled endpoint or uses it to alter images in quay.io/wire/poll-app.
  4. The workflow continues to Build and push, allowing the attacker to tamper with the image published by docker/build-push-action or 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 main push.

To resolve this comment:

✨ Commit fix suggestion

Suggested change
uses: docker/login-action@v4.6.0
uses: docker/login-action@<VERIFIED_VALUE_REQUIRED>
View step-by-step instructions
  1. Replace the mutable version tag with the full 40-character commit SHA for the trusted docker/login-action release corresponding to v4.6.0: uses: docker/login-action@<40-character-commit-sha>.
  2. Verify that the SHA belongs to the intended release in the official docker/login-action repository before using it. Do not use @v4, @v4.6.0, or a shortened SHA.
  3. Keep the existing registry, username, and password inputs 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 reasons

Alternatively, 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.

with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
Expand Down