fix(scanner): fall back to a CVE alias when grype's primary id isn't one - #746
Open
haksungjang wants to merge 1 commit into
Open
fix(scanner): fall back to a CVE alias when grype's primary id isn't one#746haksungjang wants to merge 1 commit into
haksungjang wants to merge 1 commit into
Conversation
grype sometimes assigns a non-CVE primary vulnerability id sourced from a non-NVD advisory (e.g. an Apache mailing-list thread), with the real CVE listed only under relatedVulnerabilities. The deep-cve sidecar builder silently dropped these findings entirely instead of checking for a CVE alias, losing real matches (confirmed against Apache Kafka CVE-2024-27309 in a supplier SBOM).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
docker/lib/scan-nvd-cpe.pydropped a grype match entirely whenever the primaryvulnerability.idwasn't CVE-prefixed, even when a CVE-prefixed alias was listed underrelatedVulnerabilities. Fall back to that alias instead of dropping.BIT-kafka-2024-27309(sourced from an Apache mailing-list advisory), with the CVE only inrelatedVulnerabilities.Test plan
tests/test-postprocess.sh(503 assertions, 0 failed) — newF-1fsection stubs grype's binary to return both an aliased and a non-aliased non-CVE match, confirming the alias resolves and the non-aliased one still gets droppedpython3 -m py_compile docker/lib/scan-nvd-cpe.pyshellcheck --severity=warning tests/test-postprocess.sh(clean, matches CI's invocation)