Skip to content

Commit

Permalink
feat(checker): add libmemcached checker
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 Mar 27, 2023
1 parent 7c9a67d commit aa0d701
Show file tree
Hide file tree
Showing 6 changed files with 59 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 @@ -134,6 +134,7 @@
"libksba",
"liblas",
"libmatroska",
"libmemcached",
"libnss",
"libpcap",
"libraw",
Expand Down
23 changes: 23 additions & 0 deletions cve_bin_tool/checkers/libmemcached.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2023 Orange
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for libmemcached
https://www.cvedetails.com/product/136769/Awesome-Libmemcached.html?vendor_id=28345
"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class LibmemcachedChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\nversion\r?\n(?:./src/|)libmemcached",
r"mem(?:aslap|capable|cat|cp|dump|error|exist|flush|parse|ping|rm|slap|stat|touch)-([0-9]+\.[0-9]+\.[0-9]+)",
]
VENDOR_PRODUCT = [("awesome", "libmemcached")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
35 changes: 35 additions & 0 deletions test/test_data/libmemcached.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (C) 2023 Orange
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{
"product": "libmemcached",
"version": "1.0.18",
"version_strings": ["memcp-1.0.18"],
},
{
"product": "libmemcached",
"version": "1.0.18",
"version_strings": ["1.0.18\nversion\nlibmemcached"],
},
]
package_test_data = [
{
"url": "http://rpmfind.net/linux/fedora/linux/releases/34/Everything/aarch64/os/Packages/l/",
"package_name": "libmemcached-1.0.18-22.fc34.aarch64.rpm",
"product": "libmemcached",
"version": "1.0.18",
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/libm/libmemcached/",
"package_name": "libmemcached11_1.0.18-4.1_amd64.deb",
"product": "libmemcached",
"version": "1.0.18",
},
{
"url": "http://ftp.fr.debian.org/debian/pool/main/libm/libmemcached/",
"package_name": "libmemcached11_1.1.4-1_arm64.deb",
"product": "libmemcached",
"version": "1.1.4",
},
]

0 comments on commit aa0d701

Please sign in to comment.