Skip to content

fix: pin trivy-action by SHA to prevent supply chain attacks#80

Merged
CybotTM merged 1 commit intomainfrom
fix/pin-trivy-action-sha
Mar 20, 2026
Merged

fix: pin trivy-action by SHA to prevent supply chain attacks#80
CybotTM merged 1 commit intomainfrom
fix/pin-trivy-action-sha

Conversation

@CybotTM
Copy link
Member

@CybotTM CybotTM commented Mar 20, 2026

Summary

  • Pin aquasecurity/trivy-action from mutable tag reference (@0.35.0) to immutable commit SHA (@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0)
  • All other actions in the workflow were already SHA-pinned; this was the only remaining tag reference

Why

Git tags are mutable -- a repository maintainer (or attacker with write access) can move a tag to point at a different commit. This is exactly what happened in the tj-actions/changed-files supply chain attack (March 2025), where attackers rewrote tags to inject malicious code into CI pipelines.

SHA-pinning ensures the workflow always runs the exact verified code, regardless of tag mutations. The version comment (# v0.35.0) preserves readability for Dependabot/Renovate updates.

Test plan

  • CI workflow runs successfully with the SHA-pinned reference
  • Trivy scan produces the same SARIF output as before

Pin aquasecurity/trivy-action from tag reference (v0.35.0) to its
immutable commit SHA (57a97c7e7821a5776cebc9bb87c984fa69cba8f1).

Tag references are mutable and can be moved to point at malicious
commits. SHA pinning ensures the exact verified code is always used,
mitigating supply chain attack vectors like the one disclosed in the
tj-actions/changed-files incident.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
@gemini-code-assist
Copy link

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@CybotTM CybotTM enabled auto-merge (rebase) March 20, 2026 17:38
@CybotTM CybotTM merged commit f3a95fd into main Mar 20, 2026
9 checks passed
@CybotTM CybotTM deleted the fix/pin-trivy-action-sha branch March 20, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant