Your Security Scanner Got Compromised: GitHub Actions Trust Inversion Hits Trivy and 47 Other Repos
What Happened
A systemic vulnerability class in GitHub Actions pull_request_target workflows was exploited to compromise 48 repositories — including Trivy, Aqua Security's container vulnerability scanner deployed in millions of CI/CD pipelines globally. This is the "pwn request" pattern: when a workflow using the pull_request_target trigger checks out the PR submitter's code, it grants an untrusted external contributor write permissions, secret access, and GITHUB_TOKEN in the target repository's privileged context.
Why This Is Worse Than a Typical Supply Chain Attack
Trivy isn't just another dependency — it's your security scanning tool. It runs with elevated privileges across your pipeline to inspect container images and code for vulnerabilities. A compromised Trivy binary or container image becomes the perfect supply chain injection point: it has access to everything it needs to scan, which means access to everything it could exfiltrate or tamper with. Your security tool becomes the attack vector, and it runs in trusted context by design.
| Attack Phase | Mechanism | Your Exposure |
|---|---|---|
| Initial Access | Submit PR to repo with misconfigured pull_request_target | Any repo with this pattern is exploitable by any GitHub user |
| Execution | PR head code runs in target repo context | Attacker code executes with your repo's secrets and write perms |
| Impact | Secret exfiltration, artifact tampering, supply chain injection | Trivy binaries/images in your pipeline may have been tampered |
Immediate Actions
Search your entire GitHub org for pull_request_target in workflow YAML files. Any workflow that checks out github.event.pull_request.head.sha or head.ref in this context is vulnerable. Remediate by switching to the pull_request trigger (runs in fork context) or using a workflow_run handoff pattern.
Verify Trivy integrity now. Check binary signatures, container image digests, and cosign signatures against known-good values from Aqua Security. Review recent scan results for anomalies — false negatives on known CVEs or unexpected network calls during scans could indicate a compromised scanner.
If your security scanning tool's build pipeline can be compromised by anyone who submits a pull request, your entire CI/CD trust model needs rebuilding — not patching.
What to do
Search all GitHub org repos for pull_request_target in workflow YAML files and remediate any that checkout PR head code in target context
Verify Trivy binary signatures, container image digests, and cosign signatures against Aqua Security's known-good values
Review Trivy scan results from the past 30 days for anomalies: false negatives on known CVEs or unexpected network behavior during scans
Implement org-wide GitHub Actions policy requiring security review for all workflows using pull_request_target