Insufficiently Protected Credentials Affecting github.com/aquasecurity/trivy/pkg/fanal/image/registry/ecr package, versions <0.51.2


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    EPSS
    0.04% (11th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-GOLANG-GITHUBCOMAQUASECURITYTRIVYPKGFANALIMAGEREGISTRYECR-6928918
  • published 21 May 2024
  • disclosed 20 May 2024
  • credit Luke Young

How to fix?

Upgrade github.com/aquasecurity/trivy/pkg/fanal/image/registry/ecr to version 0.51.2 or higher.

Overview

Affected versions of this package are vulnerable to Insufficiently Protected Credentials when scanning container images from a crafted malicious registry. An attacker can cause the leakage of credentials for legitimate registries by triggering the scan.

Notes:

  1. For AWS, 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:

a) The environment variables contain static AWS credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN) that have access to ECR.

b) 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.

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

  2. 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.

References

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
5.5 medium
  • Attack Vector (AV)
    Local
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    Required
  • Scope (S)
    Changed
  • Confidentiality (C)
    High
  • Integrity (I)
    None
  • Availability (A)
    None