Skip to content

Commit c5e26a8

Browse files
committed
fix: improve nghttp2 checker
Improve nghttp2 checker to avoid false positives with node and wireshark binaries which links dynamically with nghttp2 library (and saves the associated version number) Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 9bdba0c commit c5e26a8

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

cve_bin_tool/checkers/nghttp2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ class Nghttp2Checker(Checker):
1818
FILENAME_PATTERNS: list[str] = []
1919
VERSION_PATTERNS = [
2020
r"nghttp2/([0-9]+\.[0-9]+\.[0-9]+)",
21-
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\nnghttp2",
21+
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\nnghttp2[-_]",
2222
]
2323
VENDOR_PRODUCT = [("nghttp2", "nghttp2")]

test/test_data/nghttp2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
mapping_test_data = [
55
{"product": "nghttp2", "version": "1.50.0", "version_strings": ["nghttp2/1.50.0"]},
6-
{"product": "nghttp2", "version": "1.18.1", "version_strings": ["1.18.1\nnghttp2"]},
6+
{"product": "nghttp2", "version": "1.18.1", "version_strings": ["1.18.1\nnghttp2-"]},
77
]
88
package_test_data = [
99
{

test/test_data/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
"package_name": "node_v8.16.1-1_x86_64.ipk",
2929
"product": "node.js",
3030
"version": "8.16.1",
31-
"other_products": ["nghttp2", "openssl"],
31+
"other_products": ["openssl"],
3232
},
3333
]

test/test_data/wireshark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@
4040
"package_name": "libwireshark16_4.0.3-1_amd64.deb",
4141
"product": "wireshark",
4242
"version": "4.0.3",
43-
"other_products": ["lua", "nghttp2"],
43+
"other_products": ["lua"],
4444
},
4545
]

0 commit comments

Comments
 (0)