Skip to content

fix(get-cves): Store cpe update values and use to correctly fetch cves#5523

Draft
tomdottom wants to merge 1 commit intoossf:mainfrom
binary-raven:feat/fix-get-cve-with-version-update
Draft

fix(get-cves): Store cpe update values and use to correctly fetch cves#5523
tomdottom wants to merge 1 commit intoossf:mainfrom
binary-raven:feat/fix-get-cve-with-version-update

Conversation

@tomdottom
Copy link
Copy Markdown

@tomdottom tomdottom commented Feb 3, 2026

Draft outline of bugfix addressing #5517

  • Add new column to store update value from Cpe 2.3 URI
  • Populate new column when loading from NVD data source (updating other sources awaiting review of draft and general solution)
  • Update SQL Select to use update column when searching data from NVD source
  • Add test

Todo:

  • Maybe move test to a more appropriate file
  • After updating other data sources; get rid of OR where condition in SQL (if possible)
  • Update other data sources which return affected data
    • curl_source.py
    • gad_source.py
    • osv_source.py
    • purl2cpe_source.py
    • redhat_source.py
    • rsd_source.py
  • Delete commented dead code

Signed-off-by: Tom Marks <thomas.marks@palindrometech.com>
@tomdottom tomdottom force-pushed the feat/fix-get-cve-with-version-update branch from 12f868b to cfe397d Compare February 3, 2026 02:05
@tomdottom
Copy link
Copy Markdown
Author

@ffontaine could you cast an eye over the general solution in this draft PR and provide some preliminary feedback?

I've run this against the binary that caused me too find this bug, and it is reporting all expected CVEs.

My biggest outstanding question is if ProductInfo has to be updated with an update/patch field and then this used when performing db searches? If so the would mean updating every version parser, and other parsers which extract information for the ProductInfo object.

Things to note:

Cheers,

Tom

@ffontaine
Copy link
Copy Markdown
Collaborator

Sorry for the late answer, here is a first round of comments:

  • version_update appears to be very specific to NVD/NIST. To the best of my knowledge, other data sources such as OSV do not provide this type of field. Given that, I’m not sure whether adding a dedicated versionUpdate field inside cvedb.py is the right approach or even necessary. A simpler solution might be to merge version and version_update into a single version string (for example, by updating decode_cpe22 and decode_cpe23). @alex-ter, I’d be interested in your thoughts on this.
  • Remove commented-out dead code.

@tomdottom
Copy link
Copy Markdown
Author

@ffontaine thanks for those pointers. I'll take a look at the OSV data and highlighted functions, and update this fix accordingly.

@alex-ter
Copy link
Copy Markdown
Collaborator

alex-ter commented Mar 8, 2026

  • version_update appears to be very specific to NVD/NIST. To the best of my knowledge, other data sources such as OSV do not provide this type of field. Given that, I’m not sure whether adding a dedicated versionUpdate field inside cvedb.py is the right approach or even necessary. A simpler solution might be to merge version and version_update into a single version string (for example, by updating decode_cpe22 and decode_cpe23). @alex-ter, I’d be interested in your thoughts on this.

I also think correcting the CPE decoding functions is the best approach here. Indeed the CPE's "update" is practically a part of the "version" in cve-bin-tool's terminology + this will require no changes to the DB format, which is a significant simplification. Now, OTMH there may be some complications in range construction/comparisons that need to be worked out, but still this minimizes change while achieving the goal, and arguably in a more logically consistent way.

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.

3 participants