Skip to content

Commit 68527d5

Browse files
ffontaineterriko
andauthored
fix: improve luajit checker (#2993)
Improve luajit checker to avoid false positive with snort binary which links dynamically with luajit library (and saves the associated version number) Signed-off-by: Fabrice Fontaine <[email protected]> Co-authored-by: Terri Oda <[email protected]>
1 parent 2c36c02 commit 68527d5

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

cve_bin_tool/checkers/luajit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
class LuajitChecker(Checker):
1717
CONTAINS_PATTERNS: list[str] = []
1818
FILENAME_PATTERNS = [r"lua", r"luajit"]
19-
VERSION_PATTERNS = [r"LuaJIT ([0-9]+\.[0-9]+\.[0-9]+)"]
19+
VERSION_PATTERNS = [r"LuaJIT ([0-9]+\.[0-9]+\.[0-9]+)[a-z0-9\-]*(?: |\r?\njit)"]
2020
VENDOR_PRODUCT = [("luajit", "luajit")]

test/test_data/luajit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"product": "luajit",
77
"version": "2.1.0",
8-
"version_strings": ["LuaJIT 2.1.0-beta3"],
8+
"version_strings": ["LuaJIT 2.1.0-beta3 "],
99
},
1010
]
1111

test/test_data/snort.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515
"package_name": "snort-3.1.43.0-1-omv4090.aarch64.rpm",
1616
"product": "snort",
1717
"version": "3.1.43.0",
18-
"other_products": ["luajit"],
1918
},
2019
{
2120
"url": "http://rpmfind.net/linux/openmandriva/cooker/repository/x86_64/unsupported/release/",
2221
"package_name": "snort-3.1.43.0-1-omv4090.x86_64.rpm",
2322
"product": "snort",
2423
"version": "3.1.43.0",
25-
"other_products": ["luajit"],
2624
},
2725
{
2826
"url": "http://ftp.fr.debian.org/debian/pool/main/s/snort/",
@@ -47,6 +45,5 @@
4745
"package_name": "snort3_3.1.0.0-3_x86_64.ipk",
4846
"product": "snort",
4947
"version": "3.1.0.0",
50-
"other_products": ["luajit"],
5148
},
5249
]

0 commit comments

Comments
 (0)