Skip to content

Commit 02a572a

Browse files
committed
feat(checker): add musl
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent c90157e commit 02a572a

File tree

6 files changed

+55
-0
lines changed

6 files changed

+55
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@
271271
"msmtp",
272272
"mtr",
273273
"mupdf",
274+
"musl",
274275
"mutt",
275276
"mysql",
276277
"nano",

cve_bin_tool/checkers/musl.py

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

test/test_data/musl.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{
6+
"product": "musl",
7+
"version": "1.1.21",
8+
"version_strings": ["1.1.21\nMUSL_LOCPATH"],
9+
}
10+
]
11+
package_test_data = [
12+
{
13+
"url": "http://rpmfind.net/linux/openmandriva/cooker/repository/aarch64/main/release/",
14+
"package_name": "musl-1.2.5-2-omv2590.aarch64.rpm",
15+
"product": "musl",
16+
"version": "1.2.5",
17+
},
18+
{
19+
"url": "http://ftp.debian.org/debian/pool/main/m/musl/",
20+
"package_name": "musl_1.1.21-2_amd64.deb",
21+
"product": "musl",
22+
"version": "1.1.21",
23+
},
24+
{
25+
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/",
26+
"package_name": "musl-1.1.24-r3.apk",
27+
"product": "musl",
28+
"version": "1.1.24",
29+
"other_products": ["gcc"],
30+
},
31+
]

0 commit comments

Comments
 (0)