Commit 1de3595
authored
feat(nvd): improve ranges to include metadata in db_specific of CPE used to extract it (#5103)
This PR introduces various updates for handling NVD and CVE databases,
specifically related to the location of range metadata in
database_specific, and parsing and cache improvements.
**Range & Affected Parsing (NVD & CVE5)**:
- Fix logic for nested unresolved ranges and duplicate unresolved
ranges.
- Handle edge cases where `introduced` version equals `lessThanOrEqual`
(meaning it’s a specific version, not a range).
- Address how unresolved signatures are handled during processing.
- Extracted and moved `MergeRangesAndCreateAffected` logic to a common
package for reuse.
- Introduced a new `RangeWithMetadata` struct to hold unresolved ranges
and where they were extracted from, so they can be put in the
database_specific.
- Created a new function for explicitly building Git osvschema ranges,
so they always have the type value attached.
- unresolved ranges are grouped by CPE for easier understanding and use.
**CVE5 Interoperability**:
- Changed CVE5 logic to also use `RangeWithMetadata` to be consistent
across records.
**References & Links**:
- Implemented caching for canonicalizing links to improve processing
performance and avoid 429s.1 parent 9f1260e commit 1de3595
40 files changed
Lines changed: 12046 additions & 537 deletions
File tree
- vulnfeeds
- cmd
- combine-to-osv
- converters/cve/nvd-cve-osv
- conversion
- cve5
- __snapshots__
- nvd
- __snapshots__
- git
- testdata
- models
- test_data/cve5
- utility
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
324 | | - | |
325 | | - | |
| 323 | + | |
326 | 324 | | |
327 | 325 | | |
328 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 35 | | |
51 | 36 | | |
52 | 37 | | |
| |||
82 | 67 | | |
83 | 68 | | |
84 | 69 | | |
85 | | - | |
| 70 | + | |
86 | 71 | | |
87 | 72 | | |
88 | 73 | | |
| |||
0 commit comments