CVE-2025-65965
JSON

8.2high

Grype has a credential disclosure vulnerability in Grype JSON output

Severity
8.2high CVSS:4.0 by GitHub_M
Exploit likelihood
0.16% (higher than 5% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-6gxw-85q2-q646GO-2025-4160

Description

Grype is a vulnerability scanner for container images and filesystems. A credential disclosure vulnerability was found in Grype, affecting versions 0.68.0 through 0.104.0. If registry credentials are defined and the output of grype is written using the --file or --output json=<file> option, the registry credentials will be included unsanitized in the output file. This issue has been patched in version 0.104.1. Users running affected versions of grype can work around this vulnerability by redirecting stdout to a file instead of using the --file or --output options.

Affected

Product or packageVersionsReported by
anchore grype>= 0.68.0, < 0.104.1CVE List
github.com/anchore/grype (Go)from 0.68.0 before 0.104.1GitHub Advisory Database, Go Vulnerability Database

All scores

GitHub_M8.2high CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N
GitHubhigh CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N

Classification

CWE-212

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Grype is a vulnerability scanner for container images and filesystems. A credential disclosure vulnerability was found in Grype, affecting versions 0.68.0 through 0.104.0. If registry credentials are defined and the output of grype is written using the --file or --output json=<file> option, the registry credentials will be included unsanitized in the output file. This issue has been patched in version 0.104.1. Users running affected versions of grype can work around this vulnerability by redirecting stdout to a file instead of using the --file or --output options.

GitHub Advisory Database

A credential disclosure vulnerability was found in Grype, affecting versions v0.68.0 through v0.104.0. If registry credentials are defined and the output of grype is written using the --file or --output json=<file> option, the registry credentials will be included unsanitized in the output file.

Impact

In Grype versions v0.68.0 through v0.104.0, when registry authentication is configured, those credentials can be incorrectly included in the output of a Grype scan (regardless of whether those credentials are actively being used for the current scan). Users that do not have registry authentication configured are not affected by this issue.

Registry credentials can be set via the Grype configuration file (e.g. registry.auth[].username, registry.auth[].password, registry.auth[].token) or environment variables (e.g., GRYPE_REGISTRY_AUTH_USERNAME, GRYPE_REGISTRY_AUTH_PASSWORD, GRYPE_REGISTRY_AUTH_TOKEN).

In order for the authentication details to be improperly included, the Grype file output format must be set to json with output target set to a file. For example --output json=file.json or --output json --file file.json. When these conditions are met, the configured credentials are not sanitized as they should be in the resulting JSON output file.

The authentication details could also be leaked via a malformed Grype Template. A Grype Template that includes the Descriptor.Registry.Auth fields would also include the unsanitized registry credentials. There are no known templates that include these fields.

Patches

The patch has been released in v0.104.1.

Workaround

Users running affected versions of grype can work around this vulnerability by redirecting stdout to a file instead of using the --file or --output options.

For example, replacing the command:

# using `--output json=path` (or `--file`) leaks credentials
grype --output json=test.json alpine:latest

with

# no use of `--output json=path` or `--file`. Output is sanitized...
grype --output json alpine:latest > test.json

...results in the same test.json output, but the credentials will be properly sanitized.

Resources

Patch pull request: https://github.com/anchore/grype/pull/3068

Go Vulnerability Database

Grype has a credential disclosure vulnerability in its JSON output in github.com/anchore/grype

NVD (es)

Grype es un escáner de vulnerabilidades para imágenes de contenedores y sistemas de archivos. Se encontró una vulnerabilidad de divulgación de credenciales en Grype, que afecta a las versiones 0.68.0 a 0.104.0. Si las credenciales del registro están definidas y la salida de Grype se escribe utilizando la opción '--file' o '--output json=<file>', las credenciales del registro se incluirán sin sanitizar en el archivo de salida. Este problema ha sido parcheado en la versión 0.104.1. Los usuarios que ejecutan versiones afectadas de Grype pueden solucionar esta vulnerabilidad redirigiendo stdout a un archivo en lugar de usar las opciones '--file' o '--output'.

References

Related

Sources

SourceRecordLicence
CVE ListCVE-2025-65965 changed 2025-11-25CVE Terms of Use
GitHub Advisory DatabaseGHSA-6gxw-85q2-q646 changed 2026-09-10CC-BY-4.0
Go Vulnerability DatabaseGO-2025-4160 changed 2026-02-04CC-BY-4.0
NVDCVE-2025-65965 changed 2026-10-18Public domain