Skip to content

Commit 5d45b8e

Browse files
authored
feat(checker): add erlang/otp (#5298)
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 24d4462 commit 5d45b8e

File tree

7 files changed

+58
-0
lines changed

7 files changed

+58
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
"elfutils",
104104
"enscript",
105105
"emacs",
106+
"erlang_otp",
106107
"exfatprogs",
107108
"exim",
108109
"exiv2",
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for Erlang OTP
7+
8+
https://www.cvedetails.com/product/20874/Erlang-Erlang-otp.html?vendor_id=9446
9+
https://www.cvedetails.com/product/33599/Erlang-OTP.html?vendor_id=9446
10+
11+
"""
12+
from __future__ import annotations
13+
14+
from cve_bin_tool.checkers import Checker
15+
16+
17+
class ErlangOtpChecker(Checker):
18+
CONTAINS_PATTERNS: list[str] = []
19+
FILENAME_PATTERNS: list[str] = []
20+
VERSION_PATTERNS = [
21+
r"([0-9]+\.[0-9]+(\.[0-9]+)?(\.[0-9]+)?)\r?\nErlang/OTP",
22+
r"Erlang/OTP[a-z0-9%: \.\-\[\]]*\r?\n([0-9]+\.[0-9]+(\.[0-9]+)?(\.[0-9]+)?)",
23+
]
24+
VENDOR_PRODUCT = [("erlang", "erlang\\/otp"), ("erlang", "otp")]
261 KB
Binary file not shown.
253 KB
Binary file not shown.
497 KB
Binary file not shown.
330 KB
Binary file not shown.

test/test_data/erlang_otp.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{"product": "otp", "version": "22.0.2", "version_strings": ["22.0.2\nErlang/OTP"]}
6+
]
7+
package_test_data = [
8+
{
9+
"url": "http://rpmfind.net/linux/opensuse/ports/aarch64/tumbleweed/repo/oss/aarch64/",
10+
"package_name": "erlang-27.3.4-1.1.aarch64.rpm",
11+
"product": "erlang\\/otp",
12+
"version": "27.3.4",
13+
},
14+
{
15+
"url": "http://ftp.debian.org/debian/pool/main/e/erlang/",
16+
"package_name": "erlang-base_23.2.6%2Bdfsg-1%2Bdeb11u1_amd64.deb",
17+
"product": "erlang\\/otp",
18+
"version": "23.2.6",
19+
},
20+
{
21+
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
22+
"package_name": "erlang_21.0-3_x86_64.ipk",
23+
"product": "erlang\\/otp",
24+
"version": "21.0",
25+
},
26+
{
27+
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86/",
28+
"package_name": "erlang-24.3.4.6-r0.apk",
29+
"product": "erlang\\/otp",
30+
"version": "24.3.4.6",
31+
"other_products": ["gcc"],
32+
},
33+
]

0 commit comments

Comments
 (0)