Skip to content

Commit 0baeb7b

Browse files
authored
feat(checker): add apr checker (#4731)
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent a72b5dc commit 0baeb7b

File tree

7 files changed

+60
-0
lines changed

7 files changed

+60
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"apache_http_server",
2929
"apcupsd",
3030
"apparmor",
31+
"apr",
3132
"asn1c",
3233
"assimp",
3334
"asterisk",

cve_bin_tool/checkers/apr.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 apr
7+
8+
https://www.cvedetails.com/product/17804/Apache-Portable-Runtime.html?vendor_id=45
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class AprChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [
20+
r"apr_initialize\r?\n([0-9]+\.[0-9]+\.[0-9]+)",
21+
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\n/tmp/apr",
22+
]
23+
VENDOR_PRODUCT = [("apache", "portable_runtime")]
12.9 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

test/test_data/apr.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{
6+
"product": "portable_runtime",
7+
"version": "1.6.5",
8+
"version_strings": ["apr_initialize\n1.6.5"],
9+
}
10+
]
11+
package_test_data = [
12+
{
13+
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/a/",
14+
"package_name": "apr-1.7.5-2.fc42.aarch64.rpm",
15+
"product": "portable_runtime",
16+
"version": "1.7.5",
17+
},
18+
{
19+
"url": "http://ftp.debian.org/debian/pool/main/a/apr/",
20+
"package_name": "libapr1_1.6.5-1+b1_amd64.deb",
21+
"product": "portable_runtime",
22+
"version": "1.6.5",
23+
},
24+
{
25+
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
26+
"package_name": "libapr_1.7.0-2_x86_64.ipk",
27+
"product": "portable_runtime",
28+
"version": "1.7.0",
29+
},
30+
{
31+
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/",
32+
"package_name": "apr-1.7.0-r0.apk",
33+
"product": "portable_runtime",
34+
"version": "1.7.0",
35+
},
36+
]

0 commit comments

Comments
 (0)