DEV Community

Cover image for Your vulnerability scanner is a dependency too: pin it
Jules Robineau
Jules Robineau

Posted on Originally published at jrobineau.com

Your vulnerability scanner is a dependency too: pin it

On March 19, an attacker published Trivy v0.69.4 with stolen credentials. The same evening, they moved 76 of the 77 tags of the trivy-action action to a secret stealer. The scanner meant to protect pipelines stole their secrets for twelve hours. After that, I counted the action references in my own repositories: 689, and zero pinned to a SHA.

TL;DR: your security scanner runs inside your CI, with the job's secrets. It is a dependency, and the Trivy attack proved it. Pin every action to a full commit SHA, every image to its digest, and ban latest. Keep Dependabot or Renovate to bump the pins. My audit: 689 action references, 0 by SHA, 170 on @main.

Figures, SHAs and digests as of November 3, 2026. Check them before copying.

This article is for teams who run scanners in GitHub Actions: Trivy, Grype, gitleaks.

What happened with Trivy

Trivy is an open source vulnerability scanner, maintained by Aqua Security.

On March 19, 2026, an attacker published a poisoned release, v0.69.4, with stolen credentials. Every official channel served it. GHCR, ECR Public, Docker Hub (tags 0.69.4 and latest), deb and rpm packages, the get.trivy.dev script.

The same evening, they moved 76 of the 77 tags of aquasecurity/trivy-action to malicious commits. All 7 tags of setup-trivy followed. A moved tag changes the code of every pipeline that writes uses: aquasecurity/trivy-action@<tag>. Your workflow is identical, and it runs something else.

The added code read the runner's memory, swept the disk and sent the secrets to the attacker. The poisoned action stayed live for twelve hours, from March 19 at 17:43 UTC to March 20 at 05:40.

A single tag held: v0.35.0, covered by GitHub's immutable releases. That option locks the tag and the files of a published release. It has been open to everyone since October 28, 2025, as long as you turn it on.

Aqua's advisory is dated March 21 (CVE-2026-33634). Safe versions: Trivy 0.69.2 or 0.69.3, trivy-action 0.35.0, setup-trivy 0.2.6. Aqua's blog post says 75 tags in one place and 76 of 77 in another: I follow the official advisory. If your pipeline ran Trivy during the window, rotate every secret of the job. And the repository access token, as with GhostAction.

A tag is a promise, not a proof

An action is referenced by a repository and a git ref: actions/checkout@v4. That v4 is a tag, a label placed on a commit. Its owner can move it. So can an attacker holding the owner's credentials. And @main is a branch: it moves on every push.

A commit SHA is the fingerprint of its content. Nobody can slide other code behind a SHA you wrote down. With Trivy, nobody exploited a bug in the scanner. The attacker moved labels. A pipeline pinned by SHA never noticed.

Kubernetes made the call: full-length SHAs required across all its projects since April 15. GitHub has offered that setting since August 15, 2025.

Two other 2026 attacks target CI itself. On May 11, the Mini Shai-Hulud worm published 84 poisoned versions of 42 @tanstack/* packages in six minutes (CVE-2026-45321). No npm token was stolen. It poisoned the CI cache, then read the OIDC token from the runner's memory. In August, ChainDrop hit more than 400 npm packages, according to Microsoft. Some came from legitimate GitHub Actions workflows, so with valid provenance. No moved tag here, but the same lesson: whatever runs in your runner holds your secrets.

My audit: 689 references, zero SHAs

I took my ten repositories that have GitHub workflows. One of them, a platform of about twenty Go microservices, holds 107 workflow files. I counted every uses: pointing at a third-party or shared action, excluding local actions under ./.github/actions.

The most frequent: actions/checkout@v4, my own docker-build-push@main action, docker/build-push-action@v6, docker/login-action@v3 and actions/upload-artifact@v4. The 170 references on @main are mostly my shared composite actions, in a central repository. Every push to that repository changes the code that runs in all my pipelines, with their secrets.

689 action references, zero SHAs, and what a moved tag does in your runner

Whatever runs in your runner holds your secrets. Of my 689 references, every tag could move. A full SHA freezes the code, and the bot bumps the pin.

Dependabot watches the github-actions ecosystem in 7 of those repositories. It bumps version tags. A bumped tag is still a tag, which its owner can move.

My secret scanner has the same flaw. A pre-commit script runs the Docker image zricethezav/gitleaks:v8.30.0: a version tag, not a digest. Other repositories call a locally installed gitleaks protect --staged.

And Trivy? No Trivy or Grype step in my current CI. I ran Grype, SonarQube and OWASP ZAP on client missions, not at home. So my pipelines would not have run the poisoned Trivy. But all 689 of my references trust a label that can move, the exact mechanism of the attack. I got lucky on the name of the tool.

To run the same count on your side:

# every reference, most frequent first
grep -rhoE 'uses:\s*[^ ]+@[^ ]+' .github/workflows | sort | uniq -c | sort -rn
# the ones pinned to a full SHA
grep -rhoE 'uses:\s*[^ ]+@[0-9a-f]{40}' .github/workflows | wc -l
Enter fullscreen mode Exit fullscreen mode

What I am changing: the SHA, with the version as a comment

The change fits on one line. Before:

- uses: actions/checkout@v4
Enter fullscreen mode Exit fullscreen mode

After:

- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
Enter fullscreen mode Exit fullscreen mode

The SHA freezes the code. The comment keeps the version readable, for you and for the bot. Today, the v4 tag happens to point at this very commit. Tomorrow, maybe elsewhere. You read the SHA on the release page, next to the tag. Check that it comes from the action's repository, not a fork.

Same treatment for the rest of my top 5, and for Trivy's safe version:

- uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
- uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
- uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
Enter fullscreen mode Exit fullscreen mode

My 170 references on @main are the real work. Those are my own actions, and "it's mine, I trust it" does not hold. The central repository has its own access, its tokens, its future maintainers. I am moving those actions to version tags, then pinning the SHA.

One limit. A SHA protects you from a moved tag, not from a compromised maintainer who ships a real poisoned release. Reviewing version bumps stays necessary, see step 7 of my article on the Go supply chain.

Images too: the digest, not the tag

A Docker tag is as mobile as a git tag. Trivy's latest on Docker Hub pointed at the poisoned release. Three days later, the attacker pushed 0.69.5 and 0.69.6 with other stolen credentials. Whoever pulled latest got the poison twice.

An image's digest is its fingerprint. Docker prints it at the end of every docker pull. An image pulled by digest never changes, fixes included: the bot is what bumps it.

In my pre-commit script, before:

zricethezav/gitleaks:v8.30.0
Enter fullscreen mode Exit fullscreen mode

After:

zricethezav/gitleaks@sha256:691af3c7c5a48b16f187ce3446d5f194838f91238f27270ed36eef6359a574d9 # v8.30.0
Enter fullscreen mode Exit fullscreen mode

Same syntax in a Dockerfile FROM line or a Compose image: field.

Last point: get.trivy.dev was one of the poisoned channels. A curl … | sh inside a SHA-pinned workflow reopens the door. You froze the action, not the binary it downloads. Verify the checksum, or install a package with a fixed version and fingerprint.

On the Go side, the checksum is already there

Go developers already know this model. With go install golang.org/x/vuln/cmd/govulncheck@v1.9.0, the downloaded module is verified. Outside a module, there is no go.sum: the command asks sum.golang.org for the hash. A different hash, and the download fails. Unless you set GOSUMDB=off, which I advise against.

A newer Go downloaded by GOTOOLCHAIN=auto follows the same rule. It arrives as a golang.org/toolchain module, checked by the same database.

So: install your Go tools with an explicit version, never @latest. The checksum comes with it. That is the exact opposite of curl | sh and of the latest image.

Keep a bot to bump the pins

A SHA that is never updated ages in silence. The bot stays mandatory. Dependabot knows how to bump a SHA. It also updates the version comment, if it sits on the same line: actions/checkout@<commit> # <tag>. If the commit matches no tag, it moves you to the latest commit of the branch. So start from a release.

Careful: Dependabot security alerts only cover actions that use semantic versioning. An action pinned by SHA triggers no alert. Version update pull requests take over:

version: 2
updates:
  - package-ecosystem: github-actions
    directory: /
    schedule:
      interval: weekly
Enter fullscreen mode Exit fullscreen mode

Renovate goes further. The helpers:pinGitHubActionDigests preset replaces every tag with a SHA itself, version as a comment, then follows that comment. A bare SHA is not updated.

Then lock it down. In the Actions settings, tick "Require actions to be pinned to a full-length commit SHA". A workflow with an unpinned action fails, even for actions from your own organization. GitHub also offers an actions.lock file, generated by the gh actions-lock extension. It freezes the commit of every action, dependencies included. The file has been generally available since October 28. A "Require lockfile" policy can enforce it. Dependabot updates the file in the same pull request as the action.

The checklist

Whatever runs in your runner holds your secrets. Choose it down to the commit.

  • [ ] Count your uses: lines and the ones pinned to a full SHA
  • [ ] Replace each tag with the release's SHA, version as a comment
  • [ ] Check that the SHA comes from the action's repository, not a fork
  • [ ] Move your internal actions to tags, then to a SHA
  • [ ] Pin every image by digest: scanners, hooks, Dockerfile, Compose
  • [ ] Replace curl | sh with a versioned package or a verified checksum
  • [ ] Install Go tools with @vX.Y.Z, never @latest
  • [ ] Keep Dependabot or Renovate on github-actions, and require SHAs in the GitHub settings
  • [ ] If Trivy ran on your side on March 19 or 20, rotate every secret of the job

The takeaway

The Trivy attack did not break Trivy. It moved labels that thousands of pipelines followed blindly. My audit shows I did the same, 689 times. A security tool is a dependency: a fingerprint, a version, a bot to bump it.

Open one of your workflows and read the first uses: line. If it ends in @v4 or @main, you know what to do today.

Want a review of your pipelines, actions and images included? See my DevSecOps audit offer, or let's talk.


Sources: Aqua security advisory, GHSA-69fq-xp46-6x23 (CVE-2026-33634) · Aqua blog, Trivy supply chain attack · GitHub advisory GHSA-g7cv-rxg3-hmpx (CVE-2026-45321) · TanStack post-mortem · Tenable, Mini Shai-Hulud FAQ · Microsoft Threat Intelligence, ChainDrop · Kubernetes dev, mandatory SHA pinning · GitHub changelog, SHA pinning policy · GitHub changelog, immutable releases · GitHub changelog, workflow lockfiles generally available · GitHub, security hardening for GitHub Actions · GitHub, Actions settings for a repository · Renovate, github-actions manager · Go modules reference, authenticating modules · Go, toolchain downloads · Docker, pull by digest · Compose, image attribute

Top comments (0)