Skip to content

Commit

Permalink
fix: improve node signature (#2682)
Browse files Browse the repository at this point in the history
Improve node signature to avoid catching the following string in node
14.16.0:

// Compat. Before node v10.12.0 stdio used to throw an error so

While at it, add debian and OpenWRT test packages

Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine committed Feb 13, 2023
1 parent f8333d7 commit 0e1971c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cve_bin_tool/checkers/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ class NodeChecker(Checker):
FILENAME_PATTERNS = [r"bin/node"]
VERSION_PATTERNS = [
r"https\:\/\/nodejs.org\/download\/release\/v([0-9]+\.[0-9]+\.[0-9]+)\/",
r"node v([0-9]+\.[0-9]+\.[0-9]+)",
r"(?:\r?\n|\/)node v([0-9]+\.[0-9]+\.[0-9]+)",
]
VENDOR_PRODUCT = [("nodejs", "node.js")]
Binary file not shown.
Binary file not shown.
18 changes: 16 additions & 2 deletions test/test_data/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"product": "node.js",
"version": "9.3.0",
"version_strings": ["https://nodejs.org/download/release/v", "node v9.3.0 "],
"version_strings": ["https://nodejs.org/download/release/v", "/node v9.3.0 "],
}
]
package_test_data = [
Expand All @@ -15,5 +15,19 @@
"product": "node.js",
"version": "14.16.0",
"other_products": ["openssl", "zlib"],
}
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/n/nodejs/",
"package_name": "nodejs_0.10.29~dfsg-2_amd64.deb",
"product": "node.js",
"version": "0.10.29",
"other_products": ["openssl"],
},
{
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
"package_name": "node_v8.16.1-1_x86_64.ipk",
"product": "node.js",
"version": "8.16.1",
"other_products": ["nghttp2", "openssl"],
},
]

0 comments on commit 0e1971c

Please sign in to comment.