Skip to content

Commit ce9f93b

Browse files
authored
feat(checker): add flac checker (#2459)
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent d10d178 commit ce9f93b

File tree

6 files changed

+56
-0
lines changed

6 files changed

+56
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"ffmpeg",
6767
"file",
6868
"firefox",
69+
"flac",
6970
"freeradius",
7071
"freerdp",
7172
"fribidi",

cve_bin_tool/checkers/flac.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (C) 2022 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for flac:
7+
8+
https://www.cvedetails.com/product/12329/Flac-Libflac.html?vendor_id=7327
9+
https://www.cvedetails.com/product/46017/Flac-Project-Flac.html?vendor_id=17957
10+
11+
"""
12+
from __future__ import annotations
13+
14+
from cve_bin_tool.checkers import Checker
15+
16+
17+
class FlacChecker(Checker):
18+
CONTAINS_PATTERNS: list[str] = []
19+
FILENAME_PATTERNS: list[str] = []
20+
VERSION_PATTERNS = [
21+
r"flac-([0-9]+\.[0-9]+\.[0-9]+)",
22+
r"reference libFLAC ([0-9]+\.[0-9]+\.[0-9]+)",
23+
]
24+
VENDOR_PRODUCT = [("flac", "libflac"), ("flac_project", "flac")]
Binary file not shown.
Binary file not shown.
Binary file not shown.

test/test_data/flac.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (C) 2022 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{"product": "flac", "version": "1.4.2", "version_strings": ["flac-1.4.2"]},
6+
{
7+
"product": "flac",
8+
"version": "1.3.0",
9+
"version_strings": ["reference libFLAC 1.3.0"],
10+
},
11+
]
12+
package_test_data = [
13+
{
14+
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/f/",
15+
"package_name": "flac-1.4.2-1.fc38.aarch64.rpm",
16+
"product": "flac",
17+
"version": "1.4.2",
18+
},
19+
{
20+
"url": "http://ftp.fr.debian.org/debian/pool/main/f/flac/",
21+
"package_name": "libflac8_1.3.0-3_amd64.deb",
22+
"product": "flac",
23+
"version": "1.3.0",
24+
},
25+
{
26+
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
27+
"package_name": "libflac_1.3.3-1_x86_64.ipk",
28+
"product": "flac",
29+
"version": "1.3.3",
30+
},
31+
]

0 commit comments

Comments
 (0)