diff --git a/cve_bin_tool/checkers/__init__.py b/cve_bin_tool/checkers/__init__.py index 7065bbfe85..d72f98a4d6 100644 --- a/cve_bin_tool/checkers/__init__.py +++ b/cve_bin_tool/checkers/__init__.py @@ -154,6 +154,7 @@ "libgcrypt", "libgd", "libgit2", + "libheif", "libical", "libidn2", "libinput", diff --git a/cve_bin_tool/checkers/libheif.py b/cve_bin_tool/checkers/libheif.py new file mode 100644 index 0000000000..4dceba63e8 --- /dev/null +++ b/cve_bin_tool/checkers/libheif.py @@ -0,0 +1,20 @@ +# Copyright (C) 2023 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + + +""" +CVE checker for libheif + +https://www.cvedetails.com/product/53699/Struktur-Libheif.html?vendor_id=19782 + +""" +from __future__ import annotations + +from cve_bin_tool.checkers import Checker + + +class LibheifChecker(Checker): + CONTAINS_PATTERNS: list[str] = [] + FILENAME_PATTERNS: list[str] = [] + VERSION_PATTERNS = [r"([0-9]+\.[0-9]+\.[0-9]+)[a-zA-Z0-9/_ \r\n]*[h|H]eif"] + VENDOR_PRODUCT = [("struktur", "libheif")] diff --git a/test/condensed-downloads/libheif-1.17.5-1.fc40.aarch64.rpm.tar.gz b/test/condensed-downloads/libheif-1.17.5-1.fc40.aarch64.rpm.tar.gz new file mode 100644 index 0000000000..77bcdb19ef Binary files /dev/null and b/test/condensed-downloads/libheif-1.17.5-1.fc40.aarch64.rpm.tar.gz differ diff --git a/test/condensed-downloads/libheif-1.6.0-r0.apk.tar.gz b/test/condensed-downloads/libheif-1.6.0-r0.apk.tar.gz new file mode 100644 index 0000000000..bb215a9e5f Binary files /dev/null and b/test/condensed-downloads/libheif-1.6.0-r0.apk.tar.gz differ diff --git a/test/condensed-downloads/libheif1_1.3.2-2~deb10u1_amd64.deb.tar.gz b/test/condensed-downloads/libheif1_1.3.2-2~deb10u1_amd64.deb.tar.gz new file mode 100644 index 0000000000..8e0bbfa5d7 Binary files /dev/null and b/test/condensed-downloads/libheif1_1.3.2-2~deb10u1_amd64.deb.tar.gz differ diff --git a/test/test_data/libheif.py b/test/test_data/libheif.py new file mode 100644 index 0000000000..510315a53f --- /dev/null +++ b/test/test_data/libheif.py @@ -0,0 +1,26 @@ +# Copyright (C) 2023 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + +mapping_test_data = [ + {"product": "libheif", "version": "1.3.2", "version_strings": ["1.3.2\nheif"]} +] +package_test_data = [ + { + "url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/l/", + "package_name": "libheif-1.17.5-1.fc40.aarch64.rpm", + "product": "libheif", + "version": "1.17.5", + }, + { + "url": "http://ftp.fr.debian.org/debian/pool/main/libh/libheif/", + "package_name": "libheif1_1.3.2-2~deb10u1_amd64.deb", + "product": "libheif", + "version": "1.3.2", + }, + { + "url": "https://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/", + "package_name": "libheif-1.6.0-r0.apk", + "product": "libheif", + "version": "1.6.0", + }, +]