cve-check: add support for cvss v4.0

https://nvd.nist.gov/general/news/cvss-v4-0-official-support

CVSS v4.0 was released in November 2023
NVD announced support for it in June 2024

Current stats are:
* cvss v4 provided, but also v3, so cve-check showed a value
sqlite> select count(*) from nvd where scorev4 != 0.0 and scorev3 != 0.0;
2069
* only cvss v4 provided, so cve-check did not show any
sqlite> select count(*) from nvd where scorev4 != 0.0 and scorev3 = 0.0;
260

(From OE-Core rev: 7ce34ce58f83bc02fa2c04bec54e358e8614157e)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 358dbfcd80ae1fa414d294c865dd293670c287f0)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
Peter Marko
2024-10-23 11:45:22 +02:00
committed by Steve Sakoman
parent 6a44d7c078
commit a99c033f4c
4 changed files with 19 additions and 8 deletions

View File

@@ -31,7 +31,7 @@
CVE_PRODUCT ??= "${BPN}"
CVE_VERSION ??= "${PV}"
CVE_CHECK_DB_FILENAME ?= "nvdcve_2-1.db"
CVE_CHECK_DB_FILENAME ?= "nvdcve_2-2.db"
CVE_CHECK_DB_DIR ?= "${STAGING_DIR}/CVE_CHECK"
CVE_CHECK_DB_FILE ?= "${CVE_CHECK_DB_DIR}/${CVE_CHECK_DB_FILENAME}"
CVE_CHECK_DB_FILE_LOCK ?= "${CVE_CHECK_DB_FILE}.lock"
@@ -445,9 +445,10 @@ def get_cve_info(d, cve_data):
cve_data[row[0]]["NVD-summary"] = row[1]
cve_data[row[0]]["NVD-scorev2"] = row[2]
cve_data[row[0]]["NVD-scorev3"] = row[3]
cve_data[row[0]]["NVD-modified"] = row[4]
cve_data[row[0]]["NVD-vector"] = row[5]
cve_data[row[0]]["NVD-vectorString"] = row[6]
cve_data[row[0]]["NVD-scorev4"] = row[4]
cve_data[row[0]]["NVD-modified"] = row[5]
cve_data[row[0]]["NVD-vector"] = row[6]
cve_data[row[0]]["NVD-vectorString"] = row[7]
cursor.close()
conn.close()
@@ -534,6 +535,7 @@ def cve_write_data_json(d, cve_data, cve_status):
cve_item["summary"] = cve_data[cve]["NVD-summary"]
cve_item["scorev2"] = cve_data[cve]["NVD-scorev2"]
cve_item["scorev3"] = cve_data[cve]["NVD-scorev3"]
cve_item["scorev4"] = cve_data[cve]["NVD-scorev4"]
cve_item["modified"] = cve_data[cve]["NVD-modified"]
cve_item["vector"] = cve_data[cve]["NVD-vector"]
cve_item["vectorString"] = cve_data[cve]["NVD-vectorString"]

View File

@@ -282,6 +282,7 @@ def cve_write_data_json(d, cve_data, cve_status):
cve_item["summary"] = cve_data[cve]["NVD-summary"]
cve_item["scorev2"] = cve_data[cve]["NVD-scorev2"]
cve_item["scorev3"] = cve_data[cve]["NVD-scorev3"]
cve_item["scorev4"] = cve_data[cve]["NVD-scorev4"]
cve_item["vector"] = cve_data[cve]["NVD-vector"]
cve_item["vectorString"] = cve_data[cve]["NVD-vectorString"]
if 'status' in cve_data[cve]: