github.com/aquasecurity/trivy
Affected
- introduced
0, fixed0.51.2(semver)
Fixed versions
0.51.2
Fix
- Fixed version
0.51.2go get github.com/aquasecurity/[email protected]
Advisory
Also known as: CVE-2024-35192, GO-2024-2870
Trivy possibly leaks registry credential when scanning images from malicious registries
Impact
If a malicious actor is able to trigger Trivy to scan container images from a crafted malicious registry, it could result in the leakage of credentials for legitimate registries such as AWS Elastic Container Registry (ECR), Google Cloud Artifact/Container Registry, or Azure Container Registry (ACR). These tokens can then be used to push/pull images from those registries to which the identity/user running Trivy has access.
Taking AWS as an example, the leakage only occurs when Trivy is able to transparently obtain registry credentials from the default credential provider chain. You are affected if Trivy is executed in any of the following situations:
You are not affected if the default credential provider chain is unable to obtain valid credentials. The same applies to GCP and Azure.
Workarounds
If you are using Trivy v0.51.2 or later, you are not affected. If you are using Trivy v0.51.1 or prior, you should ensure you only scan images from trusted registries.
This vulnerability only applies when scanning container images directly from a registry. If you use Docker, containerd or other runtime to pull images locally and scan them with Trivy, you are not affected. To enforce this behavior, you can use the --image-src flag to select which sources you trust.
Medium Basis: The source's own band: MODERATE
0, fixed 0.51.2 (semver)0.51.2
0.51.2go get github.com/aquasecurity/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0