Skip to content

Commit 7c3e8c7

Browse files
committed
feat(checker): add readline checker
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 9bdba0c commit 7c3e8c7

File tree

6 files changed

+59
-0
lines changed

6 files changed

+59
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239
"raptor",
240240
"rauc",
241241
"rdesktop",
242+
"readline",
242243
"rtl_433",
243244
"rtmpdump",
244245
"rsync",

cve_bin_tool/checkers/readline.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (C) 2023 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for readline
7+
8+
https://www.cvedetails.com/product/28345/GNU-Readline.html?vendor_id=72
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class ReadlineChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [
20+
r"([0-9]+\.[0-9]+)\r?\n_\*\\AaIiCcDdPpYyRrSsXx~",
21+
r"libreadline.so.([0-9]+\.[0-9]+)",
22+
]
23+
VENDOR_PRODUCT = [("gnu", "readline")]
Binary file not shown.
Binary file not shown.
Binary file not shown.

test/test_data/readline.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (C) 2023 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{
6+
"product": "readline",
7+
"version": "8.0",
8+
"version_strings": ["8.0\n_*\\AaIiCcDdPpYyRrSsXx~"],
9+
},
10+
{
11+
"product": "readline",
12+
"version": "8.2",
13+
"version_strings": ["libreadline.so.8.2"],
14+
},
15+
]
16+
package_test_data = [
17+
{
18+
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/r/",
19+
"package_name": "readline-8.2-3.fc38.aarch64.rpm",
20+
"product": "readline",
21+
"version": "8.2",
22+
},
23+
{
24+
"url": "http://ftp.fr.debian.org/debian/pool/main/r/readline/",
25+
"package_name": "libreadline7_7.0-5_amd64.deb",
26+
"product": "readline",
27+
"version": "7.0",
28+
},
29+
{
30+
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/base/",
31+
"package_name": "libreadline8_8.0-1_x86_64.ipk",
32+
"product": "readline",
33+
"version": "8.0",
34+
},
35+
]

0 commit comments

Comments
 (0)