Skip to content

Fix security vulnerabilities in install-trivy and run-trivy#12

Merged
JasonPierce merged 6 commits intomainfrom
fix/issue-11
Apr 3, 2026
Merged

Fix security vulnerabilities in install-trivy and run-trivy#12
JasonPierce merged 6 commits intomainfrom
fix/issue-11

Conversation

@JasonPierce
Copy link
Copy Markdown
Contributor

@JasonPierce JasonPierce commented Apr 3, 2026

Summary

  • Fix word splitting on skip_dirs/skip_files by using ${VAR:+--flag "$VAR"} parameter expansion
  • Prevent log injection by wrapping Trivy output in ::stop-commands:: guards
  • Fix code injection in install-trivy by moving version input to env var
  • Replace deprecated apt-key with gpg --dearmor into /etc/apt/keyrings/
  • Fix duplicate sources list entries by removing -a flag from tee

Closes #11

Test plan

  • Verify run-trivy scan works with skip_dirs and skip_files containing spaces
  • Verify Trivy output renders correctly with ::stop-commands:: guards
  • Verify install-trivy installs the correct version via env var
  • Verify install-trivy works on Ubuntu 22.04+ runners with new keyring approach
  • Verify running install-trivy twice doesn't create duplicate sources entries

Use ${VAR:+--flag "$VAR"} for skip_dirs/skip_files to prevent word
splitting, and wrap Trivy output in ::stop-commands:: guards to prevent
workflow command injection via log output.
…all-trivy

Move version input to env var to prevent code injection, replace
deprecated apt-key with gpg --dearmor into /etc/apt/keyrings, and
use tee without -a to avoid duplicate sources list entries.
@JasonPierce JasonPierce merged commit 99542a6 into main Apr 3, 2026
15 checks passed
@JasonPierce JasonPierce deleted the fix/issue-11 branch April 3, 2026 03:24
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.

Fix security vulnerabilities in install-trivy and run-trivy actions

1 participant