Commit eb54353
refactor(vuls2): drop the RPM-comparison fallback from CPE matching
vendorProductEligible mirrored go-cve-dictionary's match() by re-evaluating
a range with RPM-style comparison when the semver comparator could not parse
the query (e.g. juniper "21.4r3", safari "1.0.0b1"), reporting in-range hits
at VendorProductMatch. Empirically that fallback is neither necessary nor
sufficient:
- Not necessary: with a well-formed query the matcher already reaches every
affected version at ExactVersionMatch. Normalising juniper's joined form to
version=21.4 / update=r3 makes the same wildcard range ("< 22.2") evaluate
as plain semver; detection is byte-identical with the fallback on or off
(199 CVEs either way). The fallback only compensates for a malformed query
representation, which is a detect-side normalizer's responsibility.
- Not sufficient: RPM comparison gives no consistent order for NVD's messy
pre-release strings. "4.0_beta" > "4.0" but "4beta" < "4.0" (the same
"4 beta" ordered oppositely by NVD spelling), and "1.0.0b1" > "1.0.0". It
only lands correct when the leading version digits already dominate; near a
boundary it mis-orders. Vendors like safari, whose NVD version formats are
inconsistent, cannot be served by any version-comparison heuristic here.
The fallback only ever produced the retired RoughVersionMatch tier (folded
to VendorProductMatch), so removing it leaves ExactVersionMatch untouched;
it drops only the fuzzy in-range VP guesses for non-semver query versions.
Splitting such version strings belongs in a future detect-side query
normalizer (tractable for regular forms like juniper, a known gap for
irregular ones like safari).
Simplify vendorProductEligible to the version-less cases (query ANY/NA, or
criterion NA), delete rangeVendorProductEligible, and drop the now-unused
go-rpm-version and cpecriterion range/criterion imports.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 0d6df31 commit eb54353
3 files changed
Lines changed: 40 additions & 265 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 12 | + | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
43 | | - | |
44 | 41 | | |
45 | 42 | | |
46 | 43 | | |
| |||
1000 | 997 | | |
1001 | 998 | | |
1002 | 999 | | |
1003 | | - | |
| 1000 | + | |
1004 | 1001 | | |
1005 | 1002 | | |
1006 | 1003 | | |
| |||
1051 | 1048 | | |
1052 | 1049 | | |
1053 | 1050 | | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
1062 | | - | |
1063 | | - | |
1064 | | - | |
1065 | | - | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
1066 | 1070 | | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | | - | |
1074 | 1071 | | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | 1072 | | |
1121 | | - | |
| 1073 | + | |
1122 | 1074 | | |
1123 | 1075 | | |
1124 | 1076 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9683 | 9683 | | |
9684 | 9684 | | |
9685 | 9685 | | |
9686 | | - | |
9687 | | - | |
9688 | | - | |
9689 | | - | |
9690 | | - | |
9691 | | - | |
| 9686 | + | |
| 9687 | + | |
| 9688 | + | |
| 9689 | + | |
| 9690 | + | |
| 9691 | + | |
| 9692 | + | |
| 9693 | + | |
9692 | 9694 | | |
9693 | 9695 | | |
9694 | 9696 | | |
| |||
9759 | 9761 | | |
9760 | 9762 | | |
9761 | 9763 | | |
9762 | | - | |
9763 | | - | |
9764 | | - | |
9765 | | - | |
9766 | | - | |
9767 | | - | |
9768 | | - | |
9769 | | - | |
9770 | | - | |
9771 | | - | |
9772 | | - | |
9773 | | - | |
9774 | | - | |
9775 | | - | |
9776 | | - | |
9777 | | - | |
9778 | | - | |
9779 | | - | |
9780 | | - | |
9781 | | - | |
9782 | | - | |
9783 | | - | |
9784 | | - | |
| 9764 | + | |
9785 | 9765 | | |
9786 | 9766 | | |
9787 | 9767 | | |
| |||
10605 | 10585 | | |
10606 | 10586 | | |
10607 | 10587 | | |
10608 | | - | |
10609 | | - | |
10610 | | - | |
10611 | | - | |
10612 | | - | |
10613 | | - | |
10614 | | - | |
10615 | | - | |
10616 | | - | |
10617 | | - | |
10618 | | - | |
10619 | | - | |
10620 | | - | |
10621 | | - | |
10622 | | - | |
10623 | | - | |
10624 | | - | |
10625 | | - | |
10626 | | - | |
10627 | | - | |
10628 | | - | |
10629 | | - | |
10630 | | - | |
10631 | | - | |
10632 | | - | |
10633 | 10588 | | |
10634 | 10589 | | |
10635 | 10590 | | |
| |||
10676 | 10631 | | |
10677 | 10632 | | |
10678 | 10633 | | |
10679 | | - | |
| 10634 | + | |
| 10635 | + | |
| 10636 | + | |
| 10637 | + | |
| 10638 | + | |
| 10639 | + | |
| 10640 | + | |
10680 | 10641 | | |
10681 | 10642 | | |
10682 | 10643 | | |
| |||
10689 | 10650 | | |
10690 | 10651 | | |
10691 | 10652 | | |
10692 | | - | |
| 10653 | + | |
10693 | 10654 | | |
10694 | 10655 | | |
10695 | 10656 | | |
| |||
10992 | 10953 | | |
10993 | 10954 | | |
10994 | 10955 | | |
10995 | | - | |
10996 | | - | |
10997 | | - | |
10998 | | - | |
10999 | | - | |
11000 | | - | |
11001 | | - | |
11002 | | - | |
11003 | | - | |
11004 | | - | |
11005 | | - | |
11006 | | - | |
11007 | | - | |
11008 | | - | |
11009 | | - | |
11010 | | - | |
11011 | | - | |
11012 | | - | |
11013 | | - | |
11014 | | - | |
11015 | | - | |
11016 | | - | |
11017 | | - | |
11018 | | - | |
11019 | | - | |
11020 | | - | |
11021 | | - | |
11022 | | - | |
11023 | | - | |
11024 | | - | |
11025 | | - | |
11026 | | - | |
11027 | | - | |
11028 | | - | |
11029 | | - | |
11030 | | - | |
11031 | | - | |
11032 | | - | |
11033 | | - | |
11034 | | - | |
11035 | | - | |
11036 | | - | |
11037 | | - | |
11038 | | - | |
11039 | | - | |
11040 | | - | |
11041 | | - | |
11042 | | - | |
11043 | | - | |
11044 | | - | |
11045 | | - | |
11046 | | - | |
11047 | | - | |
11048 | | - | |
11049 | | - | |
11050 | | - | |
11051 | | - | |
11052 | | - | |
11053 | | - | |
11054 | | - | |
11055 | | - | |
11056 | | - | |
11057 | | - | |
11058 | | - | |
11059 | | - | |
11060 | | - | |
11061 | | - | |
11062 | | - | |
11063 | | - | |
11064 | | - | |
11065 | | - | |
11066 | | - | |
11067 | | - | |
11068 | | - | |
11069 | | - | |
11070 | | - | |
11071 | | - | |
11072 | | - | |
11073 | | - | |
11074 | | - | |
11075 | | - | |
11076 | | - | |
11077 | | - | |
11078 | | - | |
11079 | | - | |
11080 | | - | |
11081 | | - | |
11082 | | - | |
11083 | | - | |
11084 | | - | |
11085 | | - | |
11086 | | - | |
11087 | | - | |
11088 | | - | |
11089 | | - | |
11090 | | - | |
11091 | | - | |
11092 | | - | |
11093 | | - | |
11094 | | - | |
11095 | | - | |
11096 | | - | |
11097 | | - | |
11098 | | - | |
11099 | | - | |
11100 | | - | |
11101 | | - | |
11102 | | - | |
11103 | | - | |
11104 | | - | |
11105 | | - | |
11106 | | - | |
11107 | | - | |
11108 | | - | |
11109 | | - | |
11110 | | - | |
11111 | | - | |
11112 | | - | |
11113 | | - | |
11114 | | - | |
11115 | | - | |
11116 | | - | |
11117 | | - | |
11118 | | - | |
11119 | | - | |
11120 | | - | |
11121 | | - | |
11122 | | - | |
11123 | | - | |
11124 | | - | |
11125 | | - | |
11126 | | - | |
11127 | | - | |
11128 | | - | |
11129 | | - | |
11130 | | - | |
11131 | | - | |
11132 | 10956 | | |
11133 | 10957 | | |
11134 | 10958 | | |
| |||
0 commit comments