Trivy Vulnerability Scanner Breached To Inject Credential-Stealing Scripts

The Trivy ecosystem has suffered its second major security breach this March, following a supply-chain attack that compromised the official GitHub Action used to run Trivy vulnerability scans in CI/CD pipelines.

An attacker with residual credentials from a previous breach successfully force-pushed 75 out of 76 version tags in the aquasecurity/trivy-action repository. These tags were modified to serve a malicious infostealer payload, turning trusted version references into a malware distribution mechanism.

Because over 10,000 workflow files on GitHub reference this action, the potential impact is massive. Currently, version tag 0.35.0 is the only safe release.

Deceptive Tag Poisoning Mechanism

The attacker executed this breach without pushing to a new branch or creating a new release, which would have triggered alerts and commit history notifications.

Instead, they utilized compromised credentials to force-update 75 existing version tags to point to new, malicious commits.

By swapping the legitimate entrypoint.sh file with an infostealer payload, they kept the rest of the codebase intact.

To hide their tracks, the attacker carefully spoofed the commit metadata. They cloned the original author names, dates, and commit messages so the history appeared normal in the git log.

Screenshot of the Socket package page for of the compromised tags of the aquasecurity/trivy-action GitHub Action, showing a "Known Malware" alert (Source: socket)
Screenshot of the Socket package page for of the compromised tags of the aquasecurity/trivy-action GitHub Action, showing a “Known Malware” alert (Source: socket)

Three-Stage Payload and Exfiltration

The malicious script is designed to run silently before the legitimate Trivy scan begins, ensuring users still see normal scan results and remain unaware of the compromise.

The malware operates in three stages: collection, encryption, and exfiltration. First, it scrapes the GitHub Actions runner processes and filesystem to harvest sensitive data.

The GitHub release page for one of the compromised releases, 0.33.1, showing all the expected metadata and an "Immutable" badge. However, the tag was force-pushed to a malicious commit on current master, as betrayed by the "0 commits to master since this release" comment (Source: socket)
The GitHub release page for one of the compromised releases, 0.33.1, showing all the expected metadata and an “Immutable” badge. However, the tag was force-pushed to a malicious commit on current master, as betrayed by the “0 commits to master since this release” comment (Source: socket)

On GitHub-hosted runners, it dumps process memory to extract secrets injected into the environment. On self-hosted runners, it systematically searches the filesystem for SSH keys, cloud provider credentials, database passwords, and cryptocurrency wallets.

After gathering the data, the malware encrypts the stolen information using AES-256-CBC and wraps the encryption key with RSA-4096.

This ensures only the attacker can unlock the stolen files. The encrypted bundle is then sent to a typosquatted domain, scan[.]aquasecurtiy[.]org.

If this primary network connection fails, the malware uses a clever fallback mechanism. It leverages the victim’s GitHub access token to create a public repository, tpcp-docs on the victim’s account, uploading the stolen data as a release asset for the attacker to retrieve later.

Indicator TypeDetails
Networkscan[.]aquasecurtiy[.]org ​
File Hash (SHA256)18a24f83e807479438dcab7a1804c51a00dafc1d526698a66e0640d1e5dd671a (entrypoint.sh) ​
Compromised Actionsaquasecurity/trivy-action tags 0.0.1 through 0.2.1, 0.33.0, 0.34.2, 0.18.0, etc.

The malware code includes a comment identifying itself as the TeamPCP Cloud stealer, a threat actor known for exploiting cloud environments for financial gain. Organizations socket using the Trivy GitHub Action must take immediate action.

Security teams should stop using version tags, pin their workflows to the safe commit SHA, or use tag 0.35.0 exclusively.

Furthermore, any pipeline that executed a compromised tag must be considered fully breached, requiring an immediate rotation of all accessible secrets, cloud credentials, and API tokens.

Follow us on Google News , LinkedIn and X to Get More Instant Updates. Set Cyberpress as a Preferred Source in Google.

Varshini
Varshini
Varshini is a Cyber Security expert in Threat Analysis, Vulnerability Assessment, and Research. Passionate about staying ahead of emerging Threats and Technologies..

Trending News

Related Stories