Skip to content

Commit

Permalink
feat(checker): add toybox checker (#4764)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine authored Feb 6, 2025
1 parent 766011a commit dea16ca
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions cve_bin_tool/checkers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@
"timescaledb",
"tinyproxy",
"tor",
"toybox",
"tpm2_tss",
"traceroute",
"transmission",
Expand Down
20 changes: 20 additions & 0 deletions cve_bin_tool/checkers/toybox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (C) 2025 Orange
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for toybox
https://www.cvedetails.com/product/117980/Toybox-Project-Toybox.html?vendor_id=27827
"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class ToyboxChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [r"toybox[A-Za-z0-9_%>/ \-\.\r\n]*([0-9]+\.[0-9]+\.[0-9]+)"]
VENDOR_PRODUCT = [("toybox_project", "toybox")]
Binary file not shown.
Binary file not shown.
21 changes: 21 additions & 0 deletions test/test_data/toybox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (C) 2025 Orange
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{"product": "toybox", "version": "0.8.9", "version_strings": ["toybox\n0.8.9"]}
]
package_test_data = [
{
"url": "http://rpmfind.net/linux/openmandriva/5.0/repository/aarch64/unsupported/release/",
"package_name": "toybox-0.7.7-1-omv4000.aarch64.rpm",
"product": "toybox",
"version": "0.7.7",
"other_products": ["gcc"],
},
{
"url": "http://ftp.debian.org/debian/pool/main/t/toybox/",
"package_name": "toybox_0.8.9+dfsg-1.1_amd64.deb",
"product": "toybox",
"version": "0.8.9",
},
]

0 comments on commit dea16ca

Please sign in to comment.