diff --git a/cve_bin_tool/checkers/__init__.py b/cve_bin_tool/checkers/__init__.py index e7337ba283..d9d1d59443 100644 --- a/cve_bin_tool/checkers/__init__.py +++ b/cve_bin_tool/checkers/__init__.py @@ -343,6 +343,7 @@ "traceroute", "transmission", "trousers", + "ttyd", "twonky_server", "u_boot", "udisks", diff --git a/cve_bin_tool/checkers/ttyd.py b/cve_bin_tool/checkers/ttyd.py new file mode 100644 index 0000000000..02df70a52a --- /dev/null +++ b/cve_bin_tool/checkers/ttyd.py @@ -0,0 +1,20 @@ +# Copyright (C) 2024 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + + +""" +CVE checker for ttyd + +https://www.cvedetails.com/product/135838/Ttyd-Project-Ttyd.html?vendor_id=29796 + +""" +from __future__ import annotations + +from cve_bin_tool.checkers import Checker + + +class TtydChecker(Checker): + CONTAINS_PATTERNS: list[str] = [] + FILENAME_PATTERNS: list[str] = [] + VERSION_PATTERNS = [r"([0-9]+\.[0-9]+\.[0-9]+)[a-z\r\n]*ttyd"] + VENDOR_PRODUCT = [("ttyd_project", "ttyd")] diff --git a/test/condensed-downloads/ttyd-1.7.4-1.3.aarch64.rpm.tar.gz b/test/condensed-downloads/ttyd-1.7.4-1.3.aarch64.rpm.tar.gz new file mode 100644 index 0000000000..c903c24098 Binary files /dev/null and b/test/condensed-downloads/ttyd-1.7.4-1.3.aarch64.rpm.tar.gz differ diff --git a/test/condensed-downloads/ttyd_1.5.2-2_x86_64.ipk.tar.gz b/test/condensed-downloads/ttyd_1.5.2-2_x86_64.ipk.tar.gz new file mode 100644 index 0000000000..dd83c5d16e Binary files /dev/null and b/test/condensed-downloads/ttyd_1.5.2-2_x86_64.ipk.tar.gz differ diff --git a/test/condensed-downloads/ttyd_1.6.3-3~bpo11+1_amd64.deb.tar.gz b/test/condensed-downloads/ttyd_1.6.3-3~bpo11+1_amd64.deb.tar.gz new file mode 100644 index 0000000000..344431b5f0 Binary files /dev/null and b/test/condensed-downloads/ttyd_1.6.3-3~bpo11+1_amd64.deb.tar.gz differ diff --git a/test/test_data/ttyd.py b/test/test_data/ttyd.py new file mode 100644 index 0000000000..1cfc02e4f9 --- /dev/null +++ b/test/test_data/ttyd.py @@ -0,0 +1,26 @@ +# Copyright (C) 2024 Orange +# SPDX-License-Identifier: GPL-3.0-or-later + +mapping_test_data = [ + {"product": "ttyd", "version": "1.6.3", "version_strings": ["1.6.3\nttyd"]} +] +package_test_data = [ + { + "url": "http://rpmfind.net/linux/opensuse/ports/aarch64/tumbleweed/repo/oss/aarch64/", + "package_name": "ttyd-1.7.4-1.3.aarch64.rpm", + "product": "ttyd", + "version": "1.7.4", + }, + { + "url": "http://ftp.fr.debian.org/debian/pool/main/t/ttyd/", + "package_name": "ttyd_1.6.3-3~bpo11+1_amd64.deb", + "product": "ttyd", + "version": "1.6.3", + }, + { + "url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/", + "package_name": "ttyd_1.5.2-2_x86_64.ipk", + "product": "ttyd", + "version": "1.5.2", + }, +]