Skip to content

Commit 0c12f88

Browse files
committed
feat(checker): add snapcast checker
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent f5c09f7 commit 0c12f88

File tree

5 files changed

+49
-0
lines changed

5 files changed

+49
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@
359359
"sdl",
360360
"seahorse",
361361
"shadowsocks_libev",
362+
"snapcast",
362363
"sngrep",
363364
"snort",
364365
"socat",

cve_bin_tool/checkers/snapcast.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 snapcast
7+
8+
https://www.cvedetails.com/product/168357/Badaix-Snapcast.html?vendor_id=34464
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class SnapcastChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [
20+
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\nSnap",
21+
r"snapserver v\r?\n([0-9]+\.[0-9]+\.[0-9]+)",
22+
]
23+
VENDOR_PRODUCT = [("badaix", "snapcast")]
Binary file not shown.
Binary file not shown.

test/test_data/snapcast.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{
6+
"product": "snapcast",
7+
"version": "0.15.0",
8+
"version_strings": ["snapserver v\n0.15.0"],
9+
}
10+
]
11+
package_test_data = [
12+
{
13+
"url": "http://ftp.debian.org/debian/pool/main/s/snapcast/",
14+
"package_name": "snapserver_0.15.0-1_amd64.deb",
15+
"product": "snapcast",
16+
"version": "0.15.0",
17+
},
18+
{
19+
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.19/community/x86_64/",
20+
"package_name": "snapcast-server-0.27.0-r4.apk",
21+
"product": "snapcast",
22+
"version": "0.27.0",
23+
"other_products": ["gcc"],
24+
},
25+
]

0 commit comments

Comments
 (0)