Skip to main content
The Trivy Compromise: 75 Version Tags Poisoned in 24 HoursIncident
4 min readFor Security Engineers

The Trivy Compromise: 75 Version Tags Poisoned in 24 Hours

What Happened

Attackers compromised the Aqua Security repository hosting Trivy, a widely used vulnerability scanner, poisoning 75 of 76 version tags. This turned a tool meant to find vulnerabilities into a delivery mechanism for malicious code. Organizations running automated pulls against these tags unknowingly introduced harmful code into their CI/CD pipelines.

In a related campaign, attackers deployed a self-propagating worm across more than 47 npm packages. The Axios attack was precise: attackers published a malicious transitive dependency and exploited it within a 39-minute window before detection.

Timeline

The exact timeline for the Trivy compromise is still under investigation, but it follows a familiar pattern seen in recent supply chain attacks:

  • T+0: Attackers gain access to the Aqua Security repository (initial access method undisclosed)
  • T+hours: Systematic poisoning of 75 version tags begins
  • T+24-48 hours: Organizations pulling updates during this period receive compromised versions
  • T+detection: Aqua Security identifies the compromise and starts remediation
  • T+days: Affected organizations begin incident response to assess the impact

The Axios incident had a much shorter timeline. Attackers published the malicious dependency, exploited the 39-minute window, and withdrew, leaving systems compromised while the package appeared clean.

Which Controls Failed or Were Missing

Dependency Pinning and Verification: Organizations using latest tags or unpinned versions automatically pulled compromised code. No cryptographic verification of package integrity was performed before deployment.

Change Detection and Approval Gates: The poisoned tags moved from repository to production without human review, as automated pipelines treated repository updates as inherently trustworthy.

Network Segmentation and Privilege Boundaries: Systems pulling dependencies had direct access to production environments or sensitive data, turning a build tool compromise into a production system compromise.

Transitive Dependency Visibility: In the Axios attack, organizations lacked visibility into second- and third-order dependencies. The malicious code arrived through a dependency of a dependency.

Time-Based Controls: No delay existed between package publication and automated consumption. The 39-minute exploitation window in the Axios attack succeeded because organizations deployed within minutes of publication.

What the Relevant Standard Requires

PCI DSS v4.0.1 Requirement 6.3.2 mandates secure development of custom software based on industry standards. It calls for reviewing custom code before release. This principle extends to your supply chain: you cannot review code if you're automatically pulling the latest version without inspection.

NIST 800-53 Rev 5 control SA-12 (Supply Chain Protection) requires supply chain protection mechanisms, including supplier reviews and contractual protections. SA-12(2) calls for supplier reviews, and SA-12(5) requires limiting harm from suppliers.

ISO/IEC 27001:2022 Control 5.19 (Information Security in Supplier Relationships) requires defining and documenting information security requirements to mitigate risks associated with supplier access to your assets. Automatically trusting a public repository grants that supplier unrestricted access to your build environment and potentially your production systems.

SOC 2 Type II Common Criteria CC6.6 addresses logical and physical access controls to prevent unauthorized access. Automatically pulling unverified dependencies violates this principle, creating an access path that bypasses your change control process.

Lessons and Action Items for Your Team

Pin Everything: Replace latest tags and version ranges with exact commit hashes or cryptographic checksums. Specify trivy:0.48.1@sha256:abc123... instead of trivy:latest. This adds maintenance overhead, but it's necessary for security.

Implement a Cooling-Off Period: Add a 72-hour delay between package publication and automated consumption. The Axios attack succeeded in a 39-minute window; this control would have prevented it. Use a private mirror or cache that only pulls packages published more than three days ago.

Map Your Transitive Dependencies: Use tools like npm ls or pip show to generate a complete dependency tree. Tools like Dependabot or Snyk can automate this mapping, but a human process is needed for reviewing the results.

Separate Your Environments: Ensure your build environment lacks production credentials. Your CI/CD system should not have direct network access to production databases. This basic network segmentation is crucial, as demonstrated by the Trivy incident.

Verify Signatures When Available: Enable signature verification in your package managers. When signatures aren't available, increase scrutiny rather than disabling verification.

Build a Rollback Procedure: Ensure you can identify every system that pulled an affected version and roll back within an hour. Test this procedure quarterly. The Trivy incident affected 75 versions; organizations that couldn't quickly identify affected systems remained compromised for days.

Review Your Trust Model: Trust in Aqua Security's repository was weaponized. This doesn't mean you should trust no one, but you should verify everyone. Trust is not a security control; verification is.

The Trivy and Axios incidents are not anomalies; they represent a new baseline. Attackers have learned that compromising widely used tools is more efficient than targeting individual systems. Your dependency management strategy must adapt to this evolving threat model.

Start with pinning and environment separation. These controls could have prevented or contained both incidents. Then add the cooling-off period and transitive dependency mapping. This is not a one-time project—it's an ongoing security posture.

Topics:Incident

You Might Also Like