Skip to content

Commit 2bb8032

Browse files
ffontaineterriko
andauthored
fix: improve nghttp2 checker (#2991)
* fix: improve nghttp2 checker Improve nghttp2 checker to avoid false positives with node and wireshark binaries which link dynamically with nghttp2 library (and save the associated version number) Signed-off-by: Fabrice Fontaine <[email protected]> * chore: merge conflict resolution --------- Signed-off-by: Fabrice Fontaine <[email protected]> Co-authored-by: Terri Oda <[email protected]>
1 parent ff7f1cc commit 2bb8032

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
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+
{
7+
"product": "nghttp2",
8+
"version": "1.18.1",
9+
"version_strings": ["1.18.1\nnghttp2-"],
10+
},
711
]
812
package_test_data = [
913
{

test/test_data/node.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@
2727
"package_name": "node_v8.16.1-1_x86_64.ipk",
2828
"product": "node.js",
2929
"version": "8.16.1",
30-
"other_products": ["nghttp2"],
3130
},
3231
]

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)