{"id":"CVE-2024-35192","aliases":["CVE-2024-35192","GHSA-xcq4-m2r3-cmrj","GO-2024-2870"],"related":["CGA-8cxc-c6v2-w87x"],"kind":"vulnerability","state":"published","title":"Trivy possibly leaks registry credential when scanning images from malicious registries","summary":"Trivy is a security scanner. Prior to 0.51.2, 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. Systems are not affected if the default credential provider chain is unable to obtain valid credentials. This vulnerability only applies when scanning container images directly from a registry. This vulnerability is fixed in 0.51.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Trivy is a security scanner. Prior to 0.51.2, 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. Systems are not affected if the default credential provider chain is unable to obtain valid credentials. This vulnerability only applies when scanning container images directly from a registry. This vulnerability is fixed in 0.51.2.","source":"cvelist"},{"lang":"en","text":"## 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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"A malicious registry can cause Trivy to leak credentials for legitimate registries such as AWS Elastic Container Registry (ECR), Google Cloud Artifact/Container Registry, or Azure Container Registry (ACR) if the registry is scanned from directly using Trivy. These tokens can then be used to push/pull images from those registries to which the identity/user running Trivy has access. 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.","format":"markdown","source":"go"},{"lang":"es","text":"Trivy es un escáner de seguridad. Antes de la versión 0.51.2, si un actor malicioso puede activar Trivy para escanear imágenes de contenedores desde un registro malicioso manipulado, podría resultar en la fuga de credenciales para registros legítimos como AWS Elastic Container Registry (ECR), Google Cloud Artifact/ Registro de contenedores o Registro de contenedores de Azure (ACR). Estos tokens se pueden usar para enviar/extraer imágenes de aquellos registros a los que tiene acceso la identidad/usuario que ejecuta Trivy. Los sistemas no se ven afectados si la cadena de proveedores de credenciales predeterminada no puede obtener credenciales válidas. Esta vulnerabilidad solo se aplica al escanear imágenes de contenedores directamente desde un registro. Esta vulnerabilidad se solucionó en 0.51.2.","source":"nvd"}],"published":"2024-05-20T20:36:53.000Z","modified":"2026-09-10T03:50:14.730Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","score":5.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:N/A:N","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-522"],"affected":[{"ranges":[{"version":"< 0.51.2","status":"affected"}],"vendor":"aquasecurity","product":"trivy","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.51.2"}],"ecosystem":"Go","package":"github.com/aquasecurity/trivy","purl":"pkg:golang/github.com/aquasecurity/trivy","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.51.2"}],"ecosystem":"Go","package":"github.com/aquasecurity/trivy","purl":"pkg:golang/github.com/aquasecurity/trivy","source":"go"}],"references":[{"url":"https://github.com/aquasecurity/trivy/security/advisories/GHSA-xcq4-m2r3-cmrj","tags":["advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/aquasecurity/trivy/commit/e7f14f729de259551203f313e57d2d9d3aa2ff87","tags":["fix","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-35192","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/aquasecurity/trivy","tags":["package"],"sources":["ghsa"]}],"credits":["@lyoung-confluent"],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-05-21T17:56:05.243Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-35192","url":"https://www.cve.org/CVERecord?id=CVE-2024-35192","licence":"CVE Terms of Use","modified":"2024-08-02T03:07:47.025Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xcq4-m2r3-cmrj","url":"https://github.com/advisories/GHSA-xcq4-m2r3-cmrj","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:14.730Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2024-2870","url":"https://pkg.go.dev/vuln/GO-2024-2870","licence":"CC-BY-4.0","modified":"2026-02-04T04:15:07.344Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-35192","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-35192","licence":"Public domain","modified":"2026-06-17T07:34:31.020Z"}],"updatedAt":"2026-11-25T22:58:40.676Z","epss":{"score":0.0019,"percentile":0.09103,"date":"2026-12-01T12:00:22.000Z"}}