Skip to content

fix(scanner): expand curated github CPE map (golang/go, davegamble/cjson) - #747

Merged
haksungjang merged 3 commits into
mainfrom
fix/github-cpe-map-expansion
Aug 28, 2026
Merged

fix(scanner): expand curated github CPE map (golang/go, davegamble/cjson)#747
haksungjang merged 3 commits into
mainfrom
fix/github-cpe-map-expansion

Conversation

@haksungjang

Copy link
Copy Markdown
Member

Summary

  • Add two GITHUB_CPE_MAP entries: golang/go -> golang:go and davegamble/cjson -> davegamble:cjson, both confirmed against NVD and recovered via a local grype CPE lookup.
  • golang/go needed a new strip_prefix mechanism in enrich-github-cpe.py: Go's git tags are go1.24.2 but NVD's version field has no go prefix. Feeding the raw tag into the CPE makes grype's version comparator fail to parse it, which floods every Go CVE ever as a false positive rather than just missing the intended match — confirmed directly (150+ spurious matches with the raw tag vs. the single correct one once stripped).

Test plan

  • tests/test-postprocess.sh (extends F-1c4) — new fixtures cover the strip_prefix path, the already-bare-version no-op case, the no-strip-needed cjson case, and a live grype CVE-recovery + false-positive-flood check for golang/go
  • python3 -m py_compile docker/lib/enrich-github-cpe.py
  • shellcheck --severity=warning tests/test-postprocess.sh (clean, matches CI's invocation)

Several maven groupIds pass enrich-maven-cpe.py's generic org.apache.*
rule but land on the wrong NVD product (e.g. org.apache.sshd ->
apache:sshd, but NVD files it under mina_sshd), or fall through with
no CPE at all (single-segment groups like log4j, rhino). Add 17
curated MAVEN_CPE_MAP entries, each verified against NVD's own
cpeMatch data and confirmed to recover the real CVE via a local
grype CPE lookup.
…son)

Two new GITHUB_CPE_MAP entries confirmed against NVD and recovered via
a local grype CPE lookup. golang/go needed a version-prefix strip:
its git tags are "go1.24.2" but NVD's version field has no "go"
prefix, and feeding the raw tag in makes grype's version comparator
fail to parse it, flooding every Go CVE ever as a false positive
instead of just missing the real match.
…pansion

# Conflicts:
#	docker/lib/enrich-github-cpe.py
#	tests/test-postprocess.sh
@haksungjang
haksungjang merged commit 6db6d63 into main Aug 28, 2026
32 checks passed
@haksungjang
haksungjang deleted the fix/github-cpe-map-expansion branch August 28, 2026 11:28
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.

1 participant