CVE-2024-35192: Github.com/aquasecurity/trivy Trivy Possibly Leaks Registry Credential Vulnerability
MODERATECVE-2024-35192 is a MODERATE (CVSS 5.5) trivy possibly leaks registry credential vulnerability (CWE-522: Insufficiently Protected Credentials) affecting Github.com/aquasecurity/trivy libraries in the Go ecosystem. The issue involves trivy possibly leaks registry credential when scanning images from malicious registries. Remediation is available by upgrading affected packages to version 0.51.2.
CVE-2024-35192 at a Glance
Security Impact
CVSS: 5.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N).
How to Fix CVE-2024-35192
To remediate this vulnerability, upgrade all affected Github.com/aquasecurity/trivy dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/aquasecurity/trivy to 0.51.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/aquasecurity/trivy
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-35192, inspect your project dependencies for Github.com/aquasecurity/trivy:
inspect dependencies for github.com/aquasecurity/trivy
Analyze the terminal output to locate any version of Github.com/aquasecurity/trivy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.51.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-522: Insufficiently Protected Credentials, where the product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval. In Github.com/aquasecurity/trivy, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-35192 Affected Github.com/aquasecurity/trivy Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/aquasecurity/trivy
|
Go |
< 0.51.2
|
0.51.2
|
References
Frequently Asked Questions
What is CVE-2024-35192?
Which Github.com/aquasecurity/trivy versions are affected?
What version fixes CVE-2024-35192?
Is github.com/aquasecurity/trivy affected?
What is the CVSS score of CVE-2024-35192?
What CWE is associated with CVE-2024-35192?
How can I check Go dependencies for CVE-2024-35192?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xcq4-m2r3-cmrj",
"modified" : "2024-05-20T22:07:21Z",
"published" : "2024-05-20T20:36:53Z",
"aliases" : [ "CVE-2024-35192" ],
"summary" : "Trivy possibly leaks registry credential when scanning images from malicious registries",
"details" : "## Impact\nIf 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.\n\nTaking AWS as an example, the leakage only occurs when Trivy is able to transparently obtain registry credentials from the default [credential provider chain](https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/#specifying-credentials). You are affected if Trivy is executed in any of the following situations:\n\n- The environment variables contain static AWS credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN) that have access to ECR.\n- 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](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) (IRSA) annotation.\n- etc.\n\nYou are not affected if the default credential provider chain is unable to obtain valid credentials. The same applies to GCP and Azure.\n\n## Workarounds\nIf 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.\n\nThis 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. \n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/aquasecurity/trivy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.51.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/aquasecurity/trivy/security/advisories/GHSA-xcq4-m2r3-cmrj"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-35192"
}, {
"type" : "WEB",
"url" : "https://github.com/aquasecurity/trivy/commit/e7f14f729de259551203f313e57d2d9d3aa2ff87"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/aquasecurity/trivy"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-522" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-05-20T20:36:53Z",
"nvd_published_at" : "2024-05-20T21:15:09Z"
}
}