Skip to content

fix(vulnfeeds): separate Linux Git/ecosystem ranges and fix inverse branch pairing - #6347

Merged
jess-lowe merged 1 commit into
google:masterfrom
jess-lowe:issue_6320_fix
Nov 13, 2026
Merged

jess-lowe merged 1 commit into
google:masterfrom
jess-lowe:issue_6320_fix

Conversation

@jess-lowe

Copy link
Copy Markdown
Contributor

Fixes #6320

Summary

Fixes two Linux kernel CVE 5.0 conversion bugs in vulnfeeds:

  1. Separate mixed git and semver ranges within a single Affected block (fix(vulnfeeds): Linux conversion labels release versions as Git commit endpoints #6320):

    • Linux CNA (bippy) records often include both versionType: "git" commit ranges and versionType: "semver" release intervals inside the same defaultStatus: "unaffected" affected block (e.g. CVE-2026-99276, CVE-2026-100080, CVE-2023-52457).
    • Previously, LinuxVersionExtractor.handleAffected inspected only versionRangesWithMetadata[0].Range.GetType() == osvschema.Range_GIT and coerced every extracted range in that block to Range_GIT, emitting release versions like 7.2.8 / 7.3 or 5.10.274 as GIT commit endpoints instead of Linux Kernel ECOSYSTEM ranges.
    • Partition extracted ranges individually (Range_GIT && IsDirectGitRange vs Range_ECOSYSTEM), and reconcile direct semver ranges from defaultStatus: "unaffected" blocks with inverse semver ranges from defaultStatus: "affected" blocks (mergeLinuxEcosystemRanges) so explicit backport intervals (e.g. [7.2.8, 7.3), [5.4.225, 5.4.268)) are preserved and 0-introduced direct semver ranges (e.g. [0, 5.15.225) in CVE-2026-100080) do not widen branch-scoped inverse intervals ([5.11.0, 5.15.225)).
  2. Fix FindInverseAffectedRanges branch-boundary pairing, duplicate branch fixes, bounded unaffected gaps, and 3/4-part versions:

    • Previously, FindInverseAffectedRanges built separate introduced and fixed slices and zipped them by index (for i := range fixed). Whenever a CVE had both an explicit mainline status: "affected" entry (e.g. 6.1) and backported unaffected stable branch entries on older branches (e.g. 5.4.*, 5.10.*, 5.15.*), sorting introduced pushed "6.1.0" between "5.16.0" and "6.2.0", shifting every subsequent (introduced[i], fixed[i]) pair across branch boundaries (producing bogus cross-branch ranges like [6.1.0, 6.6.14)).
    • Pair each sorted unaffected branch entry directly with the preceding branch boundary (nextIntroduced), deduplicate multiple unaffected entries on the same wildcard branch by keeping the latest fix version (e.g. CVE-2022-50396), support bounded lessThan unaffected gaps between affected introductions (e.g. CVE-2024-53204), skip empty intervals (introduced >= fixed), and support multi-segment 2.6.x.* wildcard prefixes / 4-part kernel versions.

(Companion ecosystem version matching support for #6319 is in #6345.)

Testing

  • Added unit tests in vulnfeeds/conversion/cve5/version_extraction_test.go covering mixed git + semver Linux CNA blocks (CVE-2026-99276, CVE-2026-100080, CVE-2023-52457 shapes) and FindInverseAffectedRanges edge cases (mainline affected + earlier backport fixes, duplicate branch wildcards, bounded lessThan unaffected gaps, and 2.6.39.* 3-part wildcards).
  • cd vulnfeeds && go test ./...
  • poetry run tools/lint_and_format.sh

@jess-lowe
jess-lowe requested review from a team and another-rex November 12, 2026 02:52
@jess-lowe
jess-lowe merged commit cafb614 into google:master Nov 13, 2026
23 checks passed
@jess-lowe
jess-lowe deleted the issue_6320_fix branch November 13, 2026 02:07
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.

fix(vulnfeeds): Linux conversion labels release versions as Git commit endpoints

2 participants