diff --git a/cve_bin_tool/checkers/__init__.py b/cve_bin_tool/checkers/__init__.py index 293baa18f4..971bdbfa52 100644 --- a/cve_bin_tool/checkers/__init__.py +++ b/cve_bin_tool/checkers/__init__.py @@ -196,6 +196,7 @@ "libgd", "libgit2", "libheif", + "libhtp", "libical", "libidn2", "libinput", diff --git a/cve_bin_tool/checkers/libhtp.py b/cve_bin_tool/checkers/libhtp.py new file mode 100644 index 0000000000..0d86aaa580 --- /dev/null +++ b/cve_bin_tool/checkers/libhtp.py @@ -0,0 +1,20 @@ +# Copyright (C) 2025 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + + +""" +CVE checker for libhtp + +https://www.cvedetails.com/product/52627/Oisf-Libhtp.html?vendor_id=17892 + +""" +from __future__ import annotations + +from cve_bin_tool.checkers import Checker + + +class LibhtpChecker(Checker): + CONTAINS_PATTERNS: list[str] = [] + FILENAME_PATTERNS: list[str] = [] + VERSION_PATTERNS = [r"LibHTP v([0-9]+\.[0-9]+\.[0-9]+)"] + VENDOR_PRODUCT = [("oisf", "libhtp")] diff --git a/test/condensed-downloads/libhtp-0.5.25-r0.apk.tar.gz b/test/condensed-downloads/libhtp-0.5.25-r0.apk.tar.gz new file mode 100644 index 0000000000..738c453738 Binary files /dev/null and b/test/condensed-downloads/libhtp-0.5.25-r0.apk.tar.gz differ diff --git a/test/condensed-downloads/libhtp2-0.5.49-1.4.aarch64.rpm.tar.gz b/test/condensed-downloads/libhtp2-0.5.49-1.4.aarch64.rpm.tar.gz new file mode 100644 index 0000000000..f5d3bd3bcf Binary files /dev/null and b/test/condensed-downloads/libhtp2-0.5.49-1.4.aarch64.rpm.tar.gz differ diff --git a/test/condensed-downloads/libhtp2_0.5.30-1_amd64.deb.tar.gz b/test/condensed-downloads/libhtp2_0.5.30-1_amd64.deb.tar.gz new file mode 100644 index 0000000000..d536ce7e23 Binary files /dev/null and b/test/condensed-downloads/libhtp2_0.5.30-1_amd64.deb.tar.gz differ diff --git a/test/test_data/libhtp.py b/test/test_data/libhtp.py new file mode 100644 index 0000000000..cb9ffcddaf --- /dev/null +++ b/test/test_data/libhtp.py @@ -0,0 +1,27 @@ +# Copyright (C) 2025 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + +mapping_test_data = [ + {"product": "libhtp", "version": "0.5.30", "version_strings": ["LibHTP v0.5.30"]} +] +package_test_data = [ + { + "url": "http://rpmfind.net/linux/opensuse/ports/aarch64/tumbleweed/repo/oss/aarch64/", + "package_name": "libhtp2-0.5.49-1.4.aarch64.rpm", + "product": "libhtp", + "version": "0.5.49", + }, + { + "url": "http://ftp.debian.org/debian/pool/main/libh/libhtp/", + "package_name": "libhtp2_0.5.30-1_amd64.deb", + "product": "libhtp", + "version": "0.5.30", + }, + { + "url": "https://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/", + "package_name": "libhtp-0.5.25-r0.apk", + "product": "libhtp", + "version": "0.5.25", + "other_products": ["gcc"], + }, +] diff --git a/test/test_data/suricata.py b/test/test_data/suricata.py index 39f633504b..955d9d039b 100644 --- a/test/test_data/suricata.py +++ b/test/test_data/suricata.py @@ -15,26 +15,27 @@ "package_name": "suricata-6.0.6-2.fc37.aarch64.rpm", "product": "suricata", "version": "6.0.6", - "other_products": ["rust"], + "other_products": ["libhtp", "rust"], }, { "url": "http://rpmfind.net/linux/fedora-secondary/development/rawhide/Everything/s390x/os/Packages/s/", "package_name": "suricata-6.0.6-2.fc37.s390x.rpm", "product": "suricata", "version": "6.0.6", - "other_products": ["rust"], + "other_products": ["libhtp", "rust"], }, { "url": "http://ftp.debian.org/debian/pool/main/s/suricata/", "package_name": "suricata_3.2.1-1+deb9u1_arm64.deb", "product": "suricata", "version": "3.2.1", + "other_products": ["libhtp"], }, { "url": "http://ftp.debian.org/debian/pool/main/s/suricata/", "package_name": "suricata_4.1.2-2+deb10u1_amd64.deb", "product": "suricata", "version": "4.1.2", - "other_products": ["rust"], + "other_products": ["libhtp", "rust"], }, ]