Repository navigation
fix(vulnfeeds): separate Linux Git/ecosystem ranges and fix inverse branch pairing - #6347
Merged
Merged
Conversation
another-rex
approved these changes
Nov 12, 2026
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.
Fixes #6320
Summary
Fixes two Linux kernel CVE 5.0 conversion bugs in
vulnfeeds:Separate mixed
gitandsemverranges within a singleAffectedblock (fix(vulnfeeds): Linux conversion labels release versions as Git commit endpoints #6320):bippy) records often include bothversionType: "git"commit ranges andversionType: "semver"release intervals inside the samedefaultStatus: "unaffected"affectedblock (e.g.CVE-2026-99276,CVE-2026-100080,CVE-2023-52457).LinuxVersionExtractor.handleAffectedinspected onlyversionRangesWithMetadata[0].Range.GetType() == osvschema.Range_GITand coerced every extracted range in that block toRange_GIT, emitting release versions like7.2.8/7.3or5.10.274asGITcommit endpoints instead ofLinuxKernelECOSYSTEMranges.Range_GIT && IsDirectGitRangevsRange_ECOSYSTEM), and reconcile direct semver ranges fromdefaultStatus: "unaffected"blocks with inverse semver ranges fromdefaultStatus: "affected"blocks (mergeLinuxEcosystemRanges) so explicit backport intervals (e.g.[7.2.8, 7.3),[5.4.225, 5.4.268)) are preserved and0-introduced direct semver ranges (e.g.[0, 5.15.225)inCVE-2026-100080) do not widen branch-scoped inverse intervals ([5.11.0, 5.15.225)).Fix
FindInverseAffectedRangesbranch-boundary pairing, duplicate branch fixes, bounded unaffected gaps, and 3/4-part versions:FindInverseAffectedRangesbuilt separateintroducedandfixedslices and zipped them by index (for i := range fixed). Whenever a CVE had both an explicit mainlinestatus: "affected"entry (e.g.6.1) and backportedunaffectedstable branch entries on older branches (e.g.5.4.*,5.10.*,5.15.*), sortingintroducedpushed"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)).nextIntroduced), deduplicate multipleunaffectedentries on the same wildcard branch by keeping the latest fix version (e.g.CVE-2022-50396), support boundedlessThanunaffected gaps between affected introductions (e.g.CVE-2024-53204), skip empty intervals (introduced >= fixed), and support multi-segment2.6.x.*wildcard prefixes / 4-part kernel versions.(Companion ecosystem version matching support for #6319 is in #6345.)
Testing
vulnfeeds/conversion/cve5/version_extraction_test.gocovering mixedgit+semverLinux CNA blocks (CVE-2026-99276,CVE-2026-100080,CVE-2023-52457shapes) andFindInverseAffectedRangesedge cases (mainlineaffected+ earlier backport fixes, duplicate branch wildcards, boundedlessThanunaffected gaps, and2.6.39.*3-part wildcards).cd vulnfeeds && go test ./...poetry run tools/lint_and_format.sh