Skip to content

Commit 960b351

Browse files
committed
fix: Improve nghttp2 heuristics
The version number can appeaer: - After a `nghttp2_` method name - Before `:authority` or `:method`
1 parent c071b6d commit 960b351

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

cve_bin_tool/checkers/nghttp2.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@ class Nghttp2Checker(Checker):
1919
VERSION_PATTERNS = [
2020
r"nghttp2/([0-9]+\.[0-9]+\.[0-9]+)",
2121
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\nnghttp2[-_]",
22+
r"nghttp2_[a-z_]+\r?\n([0-9]+\.[0-9]+\.[0-9]+)\r?\n",
23+
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\n:authority",
24+
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\n:metho",
2225
]
2326
VENDOR_PRODUCT = [("nghttp2", "nghttp2")]
Binary file not shown.
Binary file not shown.

test/test_data/nghttp2.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
"version": "1.18.1",
99
"version_strings": ["1.18.1\nnghttp2-"],
1010
},
11+
{
12+
"product": "nghttp2",
13+
"version": "1.64.0",
14+
"version_strings": ["1.64.0\n:metho"],
15+
},
16+
{
17+
"product": "nghttp2",
18+
"version": "1.59.0",
19+
"version_strings": ["1.59.0\n:authority"],
20+
},
1121
]
1222
package_test_data = [
1323
{
@@ -40,4 +50,17 @@
4050
"product": "nghttp2",
4151
"version": "1.41.0",
4252
},
53+
{
54+
"url": "https://mirror.msys2.org/msys/x86_64/",
55+
"package_name": "libnghttp2-1.64.0-1-x86_64.pkg.tar.zst",
56+
"product": "nghttp2",
57+
"version": "1.64.0",
58+
"other_products": ["gcc"],
59+
},
60+
{
61+
"url": "http://security.ubuntu.com/ubuntu/pool/main/n/nghttp2/",
62+
"package_name": "libnghttp2-14_1.59.0-1ubuntu0.1_amd64.deb",
63+
"product": "nghttp2",
64+
"version": "1.59.0",
65+
},
4366
]

0 commit comments

Comments
 (0)