Add exception for go stdlib search by CPE #1565
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 forgolang:go
, however, the GHSA correctly attributes this togolang.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).