Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/aquasecurity/trivy
  4. ›
  5. CVE-2024-35192

CVE-2024-35192: Trivy possibly leaks registry credential when scanning images from malicious registries

May 20, 2024

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:

  • The environment variables contain static AWS credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN) that have access to ECR.
  • Within a Pod running on an EKS cluster that has been assigned a role with access to ECR using an IAM Roles for Service Accounts (IRSA) annotation.
  • etc.

You are not affected if the default credential provider chain is unable to obtain valid credentials. The same applies to GCP and Azure.

References

  • github.com/advisories/GHSA-xcq4-m2r3-cmrj
  • github.com/aquasecurity/trivy
  • github.com/aquasecurity/trivy/commit/e7f14f729de259551203f313e57d2d9d3aa2ff87
  • github.com/aquasecurity/trivy/security/advisories/GHSA-xcq4-m2r3-cmrj
  • nvd.nist.gov/vuln/detail/CVE-2024-35192

Code Behaviors & Features

Detect and mitigate CVE-2024-35192 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.51.2

Fixed versions

  • 0.51.2

Solution

Upgrade to version 0.51.2 or above.

Impact 5.5 MEDIUM

CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-522: Insufficiently Protected Credentials

Source file

go/github.com/aquasecurity/trivy/CVE-2024-35192.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:02 +0000.