Summary
Grype has a credential disclosure vulnerability in its JSON output
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.
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
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.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
The patch has been released in v0.104.1.
Frequently Asked Questions
- What is CVE-2025-65965? CVE-2025-65965 is a high-severity security vulnerability in github.com/anchore/grype (go), affecting versions >= 0.68.0, < 0.104.1. It is fixed in 0.104.1.
- Which versions of github.com/anchore/grype are affected by CVE-2025-65965? github.com/anchore/grype (go) versions >= 0.68.0, < 0.104.1 is affected.
- Is there a fix for CVE-2025-65965? Yes. CVE-2025-65965 is fixed in 0.104.1. Upgrade to this version or later.
- Is CVE-2025-65965 exploitable, and should I be worried? Whether CVE-2025-65965 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2025-65965 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2025-65965? Upgrade
github.com/anchore/grypeto 0.104.1 or later.