CVE-2025-65965 — grype
Fix: anchore/grype@39f7fa1CVE-2025-65965 is a CWE-212 vulnerability in github.com/anchore/grype. A fix is available for github.com/anchore/grype — see the affected versions and patch details below.
Grype has a credential disclosure vulnerability in Grype JSON output
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2025-65965.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Real-World Exposure
github.com/anchore/grypeReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
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
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/anchore/grype | ≥ 0.68.0&&< 0.104.1 | 0.104.1go get github.com/anchore/grype@v0.104.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/anchore/grype, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/anchore/grype to 0.104.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2025-65965 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2025-65965 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2025-65965. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2025-65965 in your dependencies?
O3 Security finds CVE-2025-65965 across Go dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.