Update trivy-action to 0.34.2 and fix template injections#2
Open
Update trivy-action to 0.34.2 and fix template injections#2
Conversation
Pin aquasecurity/trivy-action to SHA (0.34.2), fixing CVE-2026-26189. Move all ${{ }} expressions from run:/script: blocks to env: blocks, eliminating template injection risk in the reusable scan workflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
aquasecurity/trivy-actionfrom@0.33.1to SHA-pinned@97e0b3872f55f89b95b2f65b3dbab56962816478(0.34.2)${{ }}expressions out ofrun:andscript:blocks intoenv:blocksContext
trivy-action version
@0.33.1is flagged by two advisories:Trivy repository compromise (2026-03-01): An attacker exploited a
pull_request_targetworkflow to steal a maintainer PAT, deleted releases 0.27.0-0.69.1, and published a malicious VSCode extension. The trivy-action code itself was not tampered with, but@0.33.1predates the post-incident hardening.CVE-2026-26189: Command injection in
entrypoint.sh-- user-supplied action inputs are written totrivy_envs.txtwithout shell escaping, then sourced. Affects 0.31.0-0.34.0, patched in 0.34.1.Template injections
This reusable workflow (
workflow_call) used${{ inputs.* }}and${{ steps.*.outputs.* }}directly inrun:blocks (11 sites) andactions/github-scriptinline JS (8 sites). While theworkflow_calltrigger limits the attack surface to internal callers, these patterns are unsafe and set a bad example as the org's canonical security scanning template.All 19 injection sites are fixed by passing values through environment variables:
run:blocks:${{ inputs.image-name }}->env: IMAGE_NAME+"${IMAGE_NAME}"actions/github-script:'${{ inputs.image-name }}'->process.env.IMAGE_NAMEWhat changed
aquasecurity/trivy-action@0.33.1->@97e0b3872f55...(0.34.2)env:env:env:env:${{ }}expressions inscript:moved toenv:+process.envNo behavioral changes. All values are identical -- they're just passed through environment variables instead of being interpolated directly into shell/JS.
Test plan
docker pullstep works correctly in registry mode