Skip to content

Commit d93bc2d

Browse files
authored
fix: update libuv checker (#4999)
Update libuv pattern to detect version in alpine package Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 400528f commit d93bc2d

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

cve_bin_tool/checkers/libuv.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class LibuvChecker(Checker):
1818
CONTAINS_PATTERNS: list[str] = []
1919
FILENAME_PATTERNS: list[str] = []
2020
VERSION_PATTERNS = [
21-
r"(?:\n|lib)uv[a-z-_\r\n]*([0-9]+\.[0-9]+\.[0-9]+)",
22-
r"([0-9]+\.[0-9]+\.[0-9]+)[a-zA-Z/_%: \-\r\n]*\r?\nUV",
21+
r"(?:\n|lib|/)uv[0-9a-z_= \-\.\r\n]*\r?\n([0-9]+\.[0-9]+\.[0-9]+)\r?\n",
22+
r"\r?\n([0-9]+\.[0-9]+\.[0-9]+)\r?\n[0-9a-zA-Z/_%:* \.\-\t\r\n]*(?:\nUV|libuv)",
2323
]
2424
VENDOR_PRODUCT = [("libuv_project", "libuv"), ("libuv", "libuv")]
Binary file not shown.

test/test_data/libuv.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

44
mapping_test_data = [
5-
{"product": "libuv", "version": "1.24.1", "version_strings": ["libuv-v1.24.1"]}
5+
{"product": "libuv", "version": "1.24.1", "version_strings": ["libuv\n1.24.1"]}
66
]
77
package_test_data = [
88
{
@@ -23,4 +23,10 @@
2323
"product": "libuv",
2424
"version": "1.40.0",
2525
},
26+
{
27+
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/",
28+
"package_name": "libuv-1.48.0-r0.apk",
29+
"product": "libuv",
30+
"version": "1.48.0",
31+
},
2632
]

test/test_data/node.py

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"package_name": "nodejs_0.10.29~dfsg-2_amd64.deb",
2222
"product": "node.js",
2323
"version": "0.10.29",
24+
"other_products": ["libuv"],
2425
},
2526
{
2627
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",

0 commit comments

Comments
 (0)