Skip to content

Commit

Permalink
fix: improve openssh signature
Browse files Browse the repository at this point in the history
Update openssh signature to avoid catching OpenSSH_3.0 strings, etc.

While at it, add debian and OpenWRT test packages

Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine committed Feb 10, 2023
1 parent 02e4438 commit 3679b11
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 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"],
},
]

0 comments on commit 3679b11

Please sign in to comment.