Skip to content

Commit b5da71f

Browse files
committed
feat(checker): add libyaml checker
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent eb8da07 commit b5da71f

File tree

6 files changed

+47
-0
lines changed

6 files changed

+47
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@
208208
"libvorbis",
209209
"libvpx",
210210
"libxslt",
211+
"libyaml",
211212
"lighttpd",
212213
"linux_kernel",
213214
"lldpd",

cve_bin_tool/checkers/libyaml.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (C) 2024 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for libyaml
7+
8+
https://www.cvedetails.com/product/27063/Pyyaml-Libyaml.html?vendor_id=13115
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class LibyamlChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [r"([0-9]+\.[0-9]+\.[0-9]+)[a-z_=&!>|()/ \.\-\r\n]*tag:yaml"]
20+
VENDOR_PRODUCT = [("pyyaml", "libyaml")]
6.45 KB
Binary file not shown.
4.79 KB
Binary file not shown.
5.98 KB
Binary file not shown.

test/test_data/libyaml.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (C) 2024 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{"product": "libyaml", "version": "0.2.1", "version_strings": ["0.2.1\ntag:yaml"]}
6+
]
7+
package_test_data = [
8+
{
9+
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/l/",
10+
"package_name": "libyaml-0.2.5-15.fc41.aarch64.rpm",
11+
"product": "libyaml",
12+
"version": "0.2.5",
13+
},
14+
{
15+
"url": "http://ftp.fr.debian.org/debian/pool/main/liby/libyaml/",
16+
"package_name": "libyaml-0-2_0.2.1-1_amd64.deb",
17+
"product": "libyaml",
18+
"version": "0.2.1",
19+
},
20+
{
21+
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
22+
"package_name": "libyaml_0.2.2-1_x86_64.ipk",
23+
"product": "libyaml",
24+
"version": "0.2.2",
25+
},
26+
]

0 commit comments

Comments
 (0)