Skip to content

Commit

Permalink
feat(checker): add ttyd checker (intel#4031)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
  • Loading branch information
ffontaine committed Apr 17, 2024
1 parent bd2ac47 commit 8e1b878
Show file tree
Hide file tree
Showing 6 changed files with 47 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 @@ -343,6 +343,7 @@
"traceroute",
"transmission",
"trousers",
"ttyd",
"twonky_server",
"u_boot",
"udisks",
Expand Down
20 changes: 20 additions & 0 deletions cve_bin_tool/checkers/ttyd.py
Original file line number Diff line number Diff line change
@@ -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")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
26 changes: 26 additions & 0 deletions test/test_data/ttyd.py
Original file line number Diff line number Diff line change
@@ -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",
},
]

0 comments on commit 8e1b878

Please sign in to comment.