Skip to content

Commit d3ca7dc

Browse files
authored
feat(checker): add libhtp checker (#5161)
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 1508acc commit d3ca7dc

File tree

7 files changed

+52
-3
lines changed

7 files changed

+52
-3
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@
196196
"libgd",
197197
"libgit2",
198198
"libheif",
199+
"libhtp",
199200
"libical",
200201
"libidn2",
201202
"libinput",

cve_bin_tool/checkers/libhtp.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for libhtp
7+
8+
https://www.cvedetails.com/product/52627/Oisf-Libhtp.html?vendor_id=17892
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class LibhtpChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [r"LibHTP v([0-9]+\.[0-9]+\.[0-9]+)"]
20+
VENDOR_PRODUCT = [("oisf", "libhtp")]
Binary file not shown.
Binary file not shown.
Binary file not shown.

test/test_data/libhtp.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{"product": "libhtp", "version": "0.5.30", "version_strings": ["LibHTP v0.5.30"]}
6+
]
7+
package_test_data = [
8+
{
9+
"url": "http://rpmfind.net/linux/opensuse/ports/aarch64/tumbleweed/repo/oss/aarch64/",
10+
"package_name": "libhtp2-0.5.49-1.4.aarch64.rpm",
11+
"product": "libhtp",
12+
"version": "0.5.49",
13+
},
14+
{
15+
"url": "http://ftp.debian.org/debian/pool/main/libh/libhtp/",
16+
"package_name": "libhtp2_0.5.30-1_amd64.deb",
17+
"product": "libhtp",
18+
"version": "0.5.30",
19+
},
20+
{
21+
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/",
22+
"package_name": "libhtp-0.5.25-r0.apk",
23+
"product": "libhtp",
24+
"version": "0.5.25",
25+
"other_products": ["gcc"],
26+
},
27+
]

test/test_data/suricata.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,27 @@
1515
"package_name": "suricata-6.0.6-2.fc37.aarch64.rpm",
1616
"product": "suricata",
1717
"version": "6.0.6",
18-
"other_products": ["rust"],
18+
"other_products": ["libhtp", "rust"],
1919
},
2020
{
2121
"url": "http://rpmfind.net/linux/fedora-secondary/development/rawhide/Everything/s390x/os/Packages/s/",
2222
"package_name": "suricata-6.0.6-2.fc37.s390x.rpm",
2323
"product": "suricata",
2424
"version": "6.0.6",
25-
"other_products": ["rust"],
25+
"other_products": ["libhtp", "rust"],
2626
},
2727
{
2828
"url": "http://ftp.debian.org/debian/pool/main/s/suricata/",
2929
"package_name": "suricata_3.2.1-1+deb9u1_arm64.deb",
3030
"product": "suricata",
3131
"version": "3.2.1",
32+
"other_products": ["libhtp"],
3233
},
3334
{
3435
"url": "http://ftp.debian.org/debian/pool/main/s/suricata/",
3536
"package_name": "suricata_4.1.2-2+deb10u1_amd64.deb",
3637
"product": "suricata",
3738
"version": "4.1.2",
38-
"other_products": ["rust"],
39+
"other_products": ["libhtp", "rust"],
3940
},
4041
]

0 commit comments

Comments
 (0)