Skip to content

Commit

Permalink
feat: enhance products with no identified vulnerabilities (intel#3254)
Browse files Browse the repository at this point in the history
Currently, cve-bin-tool will return gnu:zlib in "Products with No
Identified Vulnerabilities" if zlib is found but not affected by
CVE-2016-9842 (i.e. zlib >= 1.2.9) because NVD NIST database contains
two CPE IDs for zlib (gnu:zlib and zlib:zlib)

With this update, product with multiple vendors will not be displayed
under above section if a CVE is found with one of the vendor.

Fix intel#3169

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
  • Loading branch information
ffontaine authored Aug 17, 2023
1 parent a39eaf4 commit 6b0f36e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cve_bin_tool/output_engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,12 @@ def output_pdf(
[10, 10, 10],
)
row = 1
products_with_cves = list(map(lambda x: x[1], all_cve_data))
for product_data in all_product_data:
if all_product_data[product_data] == 0:
if (
all_product_data[product_data] == 0
and product_data.product not in products_with_cves
):
product_entry = [
product_data.vendor,
product_data.product,
Expand Down
6 changes: 5 additions & 1 deletion cve_bin_tool/output_engine/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,12 @@ def validate_cell_length(cell_name, cell_type):
table.add_column("Product")
table.add_column("Version")

products_with_cves = list(map(lambda x: x[1], all_cve_data))
for product_data in all_product_data:
if all_product_data[product_data] == 0:
if (
all_product_data[product_data] == 0
and product_data.product not in products_with_cves
):
cells = [
Text.styled(product_data.vendor, color),
Text.styled(product_data.product, color),
Expand Down

0 comments on commit 6b0f36e

Please sign in to comment.