Skip to content

Commit abd8364

Browse files
committed
feat(checker): luajit checker
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 0f24b06 commit abd8364

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"lighttpd",
7878
"logrotate",
7979
"lua",
80+
"luajit",
8081
"mariadb",
8182
"mdadm",
8283
"memcached",

cve_bin_tool/checkers/luajit.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (C) 2022 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for luajit
7+
8+
https://www.cvedetails.com/vulnerability-list/vendor_id-22486/Luajit.html
9+
10+
"""
11+
from cve_bin_tool.checkers import Checker
12+
13+
14+
class LuajitChecker(Checker):
15+
CONTAINS_PATTERNS = []
16+
FILENAME_PATTERNS = [r"lua", r"luajit"]
17+
VERSION_PATTERNS = [r"LuaJIT ([0-9]+\.[0-9]+\.[0-9]+)"]
18+
VENDOR_PRODUCT = [("luajit", "luajit")]
Binary file not shown.

test/test_data/luajit.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (C) 2022 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{
6+
"product": "luajit",
7+
"version": "2.1.0",
8+
"version_strings": ["LuaJIT 2.1.0-beta3"],
9+
},
10+
]
11+
12+
package_test_data = [
13+
{
14+
"url": "https://ftp.lysator.liu.se/pub/opensuse/tumbleweed/repo/oss/x86_64/",
15+
"package_name": "libluajit-5_1-2-2.1.0~beta3+git.1647772157.43ebb949-1.2.x86_64.rpm",
16+
"product": "luajit",
17+
"version": "2.1.0",
18+
},
19+
{
20+
"url": "http://ports.ubuntu.com/pool/universe/l/luajit/",
21+
"package_name": "luajit_2.1.0~beta3+dfsg-6_arm64.deb",
22+
"product": "luajit",
23+
"version": "2.1.0",
24+
},
25+
]

0 commit comments

Comments
 (0)