Skip to content

Commit 70973dd

Browse files
feat(checker): libsolv checker (closes #1491) (#1562)
Co-authored-by: Bread Genie <[email protected]>
1 parent 8837ce6 commit 70973dd

File tree

9 files changed

+82
-22
lines changed

9 files changed

+82
-22
lines changed

.github/actions/spelling/allow.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ libraryname
185185
librsvg
186186
libseccomp
187187
libsndfile
188+
libsolv
188189
libsoup
189190
libsqlite
190191
libsrtp

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,24 +194,24 @@ The following checkers are available for finding components in binary files:
194194

195195
<!--CHECKERS TABLE BEGIN-->
196196
| | | | Available checkers | | | |
197-
|--------------- |---------- |------------ |--------------- |---------- |------------- |---------- |
197+
|--------------- |---------- |---------- |------------ |--------------- |------------- |------------- |
198198
| accountsservice |avahi |bash |bind |binutils |bolt |bubblewrap |
199199
| busybox |bzip2 |cronie |cryptsetup |cups |curl |dbus |
200200
| dnsmasq |dovecot |dpkg |enscript |expat |ffmpeg |freeradius |
201201
| ftp |gcc |gimp |glibc |gnomeshell |gnupg |gnutls |
202202
| gpgme |gstreamer |gupnp |haproxy |hdf5 |hostapd |hunspell |
203203
| icecast |icu |irssi |kbd |kerberos |kexectools |libarchive |
204204
| libbpg |libdb |libebml |libgcrypt |libical |libjpeg_turbo |liblas |
205-
| libnss |librsvg |libseccomp |libsndfile |libsoup |libsrtp |libssh2 |
206-
| libtiff |libvirt |libvncserver |libxslt |lighttpd |logrotate |lua |
207-
| mariadb |mdadm |memcached |mtr |mysql |nano |ncurses |
208-
| nessus |netpbm |nginx |node |ntp |open_vm_tools |openafs |
209-
| openjpeg |openldap |openssh |openssl |openswan |openvpn |p7zip |
210-
| pcsc_lite |pigz |png |polarssl_fedora |poppler |postgresql |pspp |
211-
| python |qt |radare2 |rsyslog |samba |sane_backends |sqlite |
212-
| strongswan |subversion |sudo |syslogng |systemd |tcpdump |trousers |
213-
| varnish |webkitgtk |wireshark |wpa_supplicant |xerces |xml2 |zlib |
214-
| zsh | | | | | | |
205+
| libnss |librsvg |libseccomp |libsndfile |libsolv |libsoup |libsrtp |
206+
| libssh2 |libtiff |libvirt |libvncserver |libxslt |lighttpd |logrotate |
207+
| lua |mariadb |mdadm |memcached |mtr |mysql |nano |
208+
| ncurses |nessus |netpbm |nginx |node |ntp |open_vm_tools |
209+
| openafs |openjpeg |openldap |openssh |openssl |openswan |openvpn |
210+
| p7zip |pcsc_lite |pigz |png |polarssl_fedora |poppler |postgresql |
211+
| pspp |python |qt |radare2 |rsyslog |samba |sane_backends |
212+
| sqlite |strongswan |subversion |sudo |syslogng |systemd |tcpdump |
213+
| trousers |varnish |webkitgtk |wireshark |wpa_supplicant |xerces |xml2 |
214+
| zlib |zsh | | | | | |
215215
<!--CHECKERS TABLE END-->
216216

217217
All the checkers can be found in the checkers directory, as can the

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"librsvg",
6565
"libseccomp",
6666
"libsndfile",
67+
"libsolv",
6768
"libsoup",
6869
"libsrtp",
6970
"libssh2",

cve_bin_tool/checkers/libsolv.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (C) 2022 Intel Corporation
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
"""
5+
CVE checker for libsolv
6+
7+
https://www.cvedetails.com/vulnerability-list/vendor_id-8184/product_id-51703/Opensuse-Libsolv.html
8+
9+
"""
10+
11+
from cve_bin_tool.checkers import Checker
12+
13+
14+
class LibsolvChecker(Checker):
15+
CONTAINS_PATTERNS = []
16+
FILENAME_PATTERNS = [r"libsolv.so", r"libsolvext.so"]
17+
VERSION_PATTERNS = [r"libsolv(?:\.so\.1)?-([0-9]+\.[0-9]+\.[0-9]+)"]
18+
VENDOR_PRODUCT = [("opensuse", "libsolv")]

doc/MANUAL.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,24 +118,24 @@ which is useful if you're trying the latest code from
118118

119119
<!--CHECKERS TABLE BEGIN-->
120120
| | | | Available checkers | | | |
121-
|--------------- |---------- |------------ |--------------- |---------- |------------- |---------- |
121+
|--------------- |---------- |---------- |------------ |--------------- |------------- |------------- |
122122
| accountsservice |avahi |bash |bind |binutils |bolt |bubblewrap |
123123
| busybox |bzip2 |cronie |cryptsetup |cups |curl |dbus |
124124
| dnsmasq |dovecot |dpkg |enscript |expat |ffmpeg |freeradius |
125125
| ftp |gcc |gimp |glibc |gnomeshell |gnupg |gnutls |
126126
| gpgme |gstreamer |gupnp |haproxy |hdf5 |hostapd |hunspell |
127127
| icecast |icu |irssi |kbd |kerberos |kexectools |libarchive |
128128
| libbpg |libdb |libebml |libgcrypt |libical |libjpeg_turbo |liblas |
129-
| libnss |librsvg |libseccomp |libsndfile |libsoup |libsrtp |libssh2 |
130-
| libtiff |libvirt |libvncserver |libxslt |lighttpd |logrotate |lua |
131-
| mariadb |mdadm |memcached |mtr |mysql |nano |ncurses |
132-
| nessus |netpbm |nginx |node |ntp |open_vm_tools |openafs |
133-
| openjpeg |openldap |openssh |openssl |openswan |openvpn |p7zip |
134-
| pcsc_lite |pigz |png |polarssl_fedora |poppler |postgresql |pspp |
135-
| python |qt |radare2 |rsyslog |samba |sane_backends |sqlite |
136-
| strongswan |subversion |sudo |syslogng |systemd |tcpdump |trousers |
137-
| varnish |webkitgtk |wireshark |wpa_supplicant |xerces |xml2 |zlib |
138-
| zsh | | | | | | |
129+
| libnss |librsvg |libseccomp |libsndfile |libsolv |libsoup |libsrtp |
130+
| libssh2 |libtiff |libvirt |libvncserver |libxslt |lighttpd |logrotate |
131+
| lua |mariadb |mdadm |memcached |mtr |mysql |nano |
132+
| ncurses |nessus |netpbm |nginx |node |ntp |open_vm_tools |
133+
| openafs |openjpeg |openldap |openssh |openssl |openswan |openvpn |
134+
| p7zip |pcsc_lite |pigz |png |polarssl_fedora |poppler |postgresql |
135+
| pspp |python |qt |radare2 |rsyslog |samba |sane_backends |
136+
| sqlite |strongswan |subversion |sudo |syslogng |systemd |tcpdump |
137+
| trousers |varnish |webkitgtk |wireshark |wpa_supplicant |xerces |xml2 |
138+
| zlib |zsh | | | | | |
139139
<!--CHECKERS TABLE END-->
140140

141141
For a quick overview of usage and how it works, you can also see [the readme file](README.md).
28 KB
Binary file not shown.
29.1 KB
Binary file not shown.
32.7 KB
Binary file not shown.

test/test_data/libsolv.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright (C) 2021 Intel Corporation
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{
6+
"product": "libsolv",
7+
"version": "0.6.34",
8+
"version_strings": ["libsolv-0.6.34"],
9+
},
10+
{
11+
"product": "libsolv",
12+
"version": "0.7.16",
13+
"version_strings": ["libsolv.so.1-0.7.16"],
14+
},
15+
{
16+
"product": "libsolv",
17+
"version": "0.7.17",
18+
"version_strings": ["libsolv.so.1-0.7.17"],
19+
},
20+
]
21+
package_test_data = [
22+
{
23+
"url": "http://mirror.centos.org/centos/7/os/x86_64/Packages/",
24+
"package_name": "libsolv-0.6.34-4.el7.x86_64.rpm",
25+
"product": "libsolv",
26+
"version": "0.6.34",
27+
},
28+
{
29+
"url": "http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/",
30+
"package_name": "libsolv-0.7.16-2.el8.x86_64.rpm",
31+
"product": "libsolv",
32+
"version": "0.7.16",
33+
},
34+
{
35+
"url": "https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/34/Everything/x86_64/os/Packages/l/",
36+
"package_name": "libsolv-0.7.17-3.fc34.x86_64.rpm",
37+
"product": "libsolv",
38+
"version": "0.7.17",
39+
},
40+
]

0 commit comments

Comments
 (0)