Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(CVSSv4): Add support for CVSSv4 to cve-bin-tool #4944

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

JigyasuRajput
Copy link
Contributor

Add CVSSv4 Support to CVE Binary Tool

Fixes #4238

Description

This PR introduces support for CVSS version 4.0, the latest iteration of the Common Vulnerability Scoring System. With NVD now including CVSSv4 data, this update ensures the tool uses the most accurate and up-to-date severity metrics for vulnerability assessments.

Key Changes

  • Core Functionality

    • Added CVSSv4 parsing from NVD JSON feeds (baseMetricV4 and cvssMetricV4)
    • Updated database schema to store CVSSv4 metrics
    • Prioritized CVSSv4 scores over v3/v2 when available
    • Enhanced vector string validation for CVSSv4 format
  • Testing

    • Added comprehensive unit and integration tests for CVSSv4 parsing, database insertion, and scanner prioritization
    • Verified backward compatibility with existing CVSSv3/v2 data

Verification Steps

  1. Run the tool against CVEs with CVSSv4 data (e.g., recent vulnerabilities from NVD).
  2. Verify CVSSv4 scores and vectors appear in reports, dashboards, and VEX outputs.
  3. Check the database for CVSS_4 metric entries.

Future Work

updating the docs for this feature is required, I'll create an issue for the same

@JigyasuRajput
Copy link
Contributor Author

resolved the merge conflict here

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only did a quick read through this so I could justify enabling the CI, but one little typo to fix now. I'll come back to do a more careful review after the tests run so I have more data about how long things take, but this looks promising.

@JigyasuRajput JigyasuRajput force-pushed the feat/add-support-cvssv4 branch from 4e769ca to acfc7e8 Compare March 19, 2025 12:53
@JigyasuRajput
Copy link
Contributor Author

I've fixed the test which was causing problem, also resolved the merge conflict.

@terriko
Copy link
Contributor

terriko commented Mar 19, 2025

I've re-enabled the CI tests, and I've flagged @mastersans and @anthonyharrison for review, since both of them have touched this stuff more recently than I have.

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've got a failing test:

 FAILED test/test_cvedb.py::TestCVEDB::test_new_database_schema - AssertionError: CVSS v4 metric name is not correct
assert 'CVSS-4' == 'CVSS_4'
  
  - CVSS_4
  ?     ^
  + CVSS-4
  ?     ^
======= 1 failed, 31 passed, 4 skipped, 4 warnings in 296.51s (0:04:56) ========

Probably we want all the identifiers to use either - or _ but I don't think it much matters which one we use and why you made just the one different, so I'll leave that to you to look at.

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

marking as needing changes again because I clicked the wrong button a second ago, sorry for the noise!

@JigyasuRajput
Copy link
Contributor Author

JigyasuRajput commented Mar 20, 2025

I need to take a look at this, I committed the suggestions directly from GUI here. Most likely the tests would fail (forgot to put a comment after committing)

@JigyasuRajput
Copy link
Contributor Author

the tests also needed update to use "CVSS-4", It should be working fine now

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.

feat: Add support for CVSSv4
3 participants