Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exception for go stdlib search by CPE #1565

Merged
merged 1 commit into from
Oct 20, 2023
Merged

Conversation

wagoodman
Copy link
Contributor

Fixes #1562

This PR introduces a new config option match.golang.always-use-cpe-for-stdlib (defaulting to true) allowing the golang matcher to search for the stdlib package by CPE even if CPE matching is disabled.

We lean primarily on GHSA matching for the golang ecosystem, however, there are still cases specifically for the stdlib where the data in NVD is preferred for matching. Take for example CVE-2023-24537 , which matches to golang:go when < 1.19.8 (and other ranges), however the GHSA data does not have a suggested package for this (yet) . This can lead to potential false positives, say in the case of CVE-2022-27664 where the CPE is again for golang:go, however, the GHSA correctly attributes this to golang.org/x/net.

For this reason CPE matching for the stdlib is allowed as a special case, and can override the golang using-cpes configurable (as it does by default).

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman merged commit 9750ef2 into main Oct 20, 2023
@wagoodman wagoodman deleted the golang-cpe-matching-stdlib branch October 20, 2023 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

grype v0.71.0 stopped showing vulnerabilities for Go stdlib
2 participants