The Trivy supply chain attack turned a trusted vulnerability scanner into a credential stealer. Investigators found that 76 of the 77 release tags of aquasecurity/trivy-action, the GitHub Action that wraps Aqua Security’s Trivy scanner, had been quietly repointed to malicious code. Aqua Security has confirmed the compromise and removed the malicious artifacts.
The first sign was a spike in script-execution detections on Linux GitHub Actions runners on March 19, 2026. The scripts didn’t look like normal build activity.
How the tag trick worked
Most teams pin an action by tag, for example trivy-action@0.24.0. Git tags are mutable. With write access to the repository, an attacker can force-push a tag so it points at a different commit. The release page keeps the same name, the same dates and the same description, but the code a runner downloads is different.
That is what happened here. Tag 0.24.0 resolves to a commit that isn’t reachable from the master branch. Its entrypoint.sh is 17,592 bytes, against 2,855 bytes for the legitimate file. The malicious commit also copies the author name, the message (“Upgrade trivy to v0.53.0 (#369)”) and the 2024-07-09 timestamp of a genuine earlier commit. Git lets anyone set those dates, so they prove nothing.
Only tag 0.35.0 was clean. Every release from 0.0.1 through 0.34.2 served the poisoned script. The companion setup-trivy action was compromised to run the same code.
What the stealer does
The attacker added about 105 lines ahead of the real scanner logic. The script runs its theft first, then launches Trivy as usual, so a person reading the workflow log sees a successful scan.
It starts by listing the runner processes (Runner.Worker, Runner.Listener, runsvc and run.sh) and reading their environment files for variables with “env” or “ssh” in the name. After that it branches by environment:
- On GitHub-hosted Linux runners, a Base64-encoded Python script runs with elevated privileges, finds the Runner.Worker process and scrapes its memory for GitHub Actions secrets stored as JSON with the isSecret flag set to true.
- On self-hosted runners, a different Python script sweeps the filesystem for SSH keys, AWS, Google Cloud and Azure credentials, Kubernetes configs and tokens, Docker registry logins, database passwords, CI/CD configs, Terraform and Ansible secrets, TLS private keys, .env files, cryptocurrency wallet keys and system password files.
Everything collected is encrypted with a random AES-256-CBC session key, which is itself wrapped with a hardcoded 4096-bit RSA public key. Only the attacker’s private key can open the bundle, which is packaged as tpcp.tar.gz.
Two ways to get the data out
The main route is an HTTPS POST to a lookalike domain spelling Aqua Security with a typo, a typosquat of Aqua Security’s real domain. If that returns a non-2XX response and a GitHub personal access token is available, the script falls back to GitHub itself. It creates a public repository named tpcp-docs in the victim’s account, adds a timestamped release and uploads the encrypted bundle as an asset. Afterwards it deletes its temporary files.
A second payload in Trivy 0.69.4
The scanner binary, version 0.69.4, was also compromised. When it runs, it drops a loader named sysmon.py in the user’s config folder. The loader sleeps for five minutes, probably to outlast sandbox time limits, then polls a command-and-control server about every 50 minutes. That server sits on the Internet Computer blockchain, which makes a conventional domain takedown harder.
Each cycle, the loader fetches a URL, compares it with a cached state file and, if the URL is new, downloads a binary to a temporary file named pglog and runs it as a detached process. The name imitates PostgreSQL logging. Every operation sits in a silent error handler, so failures never show. Because the attacker only has to change the URL, payloads can be swapped at will. The downloaded binary steals credentials in the same way as the action.
What teams should do now
Any pipeline that ran an affected tag may have leaked every secret available to that job. The sensible response is to rotate those secrets, including cloud keys, deploy tokens and SSH keys, and to check the GitHub accounts involved for an unexpected tpcp-docs repository. Searching logs for connections to the lookalike domain is also worthwhile.
Longer term, pinning actions to a full commit SHA rather than a tag removes this specific trick, because a SHA can’t be silently repointed. Tag 0.35.0 is the only release confirmed clean, and Aqua Security has already removed the malicious artifacts from its repositories.
The case is a reminder that a runner executes whatever an action contains, with full access to the job’s secrets and network. If an action’s code changes, every pipeline that references it trusts the new version on its next run.
Source: CrowdStrike.com