Skip to content

Commit

Permalink
fix: improve openssh signature (#2684)
Browse files Browse the repository at this point in the history
Update openssh signature to avoid catching OpenSSH_2.5 strings, etc.
This will avoid false positives with all putty test packages

While at it, add debian and OpenWRT test packages

Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine committed Feb 13, 2023
1 parent d1a5072 commit f8333d7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cve_bin_tool/checkers/openssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ class OpensshChecker(Checker):
r"slogin",
r"sshd",
]
VERSION_PATTERNS = [r"OpenSSH_([0-9]+\.[0-9]+[0-9a-z\s]*)"]
VERSION_PATTERNS = [r"\r?\nOpenSSH_([0-9]+\.[0-9]+(\.[0-9]+)?p[0-9]+)(?:\r?\n| )"]
VENDOR_PRODUCT = [("openbsd", "openssh")]
Binary file not shown.
Binary file not shown.
18 changes: 16 additions & 2 deletions test/test_data/openssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{"product": "openssh", "version": "6.9", "version_strings": ["OpenSSH_6.9"]}
{"product": "openssh", "version": "6.8p1", "version_strings": ["OpenSSH_6.8p1"]}
]
package_test_data = [
{
Expand All @@ -11,5 +11,19 @@
"product": "openssh",
"version": "6.8p1",
"other_products": [],
}
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/o/openssh/",
"package_name": "openssh-client_6.7p1-5+deb8u4_amd64.deb",
"product": "openssh",
"version": "6.7p1",
"other_products": [],
},
{
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
"package_name": "openssh-client_8.0p1-1_x86_64.ipk",
"product": "openssh",
"version": "8.0p1",
"other_products": ["putty"],
},
]
6 changes: 3 additions & 3 deletions test/test_data/putty.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
"package_name": "putty-0.77-1.3.aarch64.rpm",
"product": "putty",
"version": "0.77",
"other_products": ["openssh"],
"other_products": [],
},
{
"url": "http://rpmfind.net/linux/opensuse/ports/armv6hl/tumbleweed/repo/oss/armv6hl/",
"package_name": "putty-0.77-1.3.armv6hl.rpm",
"product": "putty",
"version": "0.77",
"other_products": ["openssh"],
"other_products": [],
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/p/putty/",
"package_name": "putty_0.70-6_arm64.deb",
"product": "putty",
"version": "0.70",
"other_products": ["openssh"],
"other_products": [],
},
]

0 comments on commit f8333d7

Please sign in to comment.