Skip to content

Commit 3fd87d3

Browse files
authored
Merge branch 'main' into change_xml_schem
2 parents aef73a7 + e2305b2 commit 3fd87d3

File tree

313 files changed

+3469
-1452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

313 files changed

+3469
-1452
lines changed

.github/actions/spelling/allow.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ busybox
6060
bzip
6161
c
6262
cabextract
63+
capnproto
6364
CDNs
6465
cfea
6566
cff
@@ -315,6 +316,7 @@ meflin
315316
memcached
316317
metadata
317318
microsoft
319+
mingw
318320
minicom
319321
minidlna
320322
miniupnpc
@@ -329,6 +331,7 @@ mpv
329331
msgid
330332
msgstr
331333
msi
334+
msys
332335
mtr
333336
mutt
334337
myfork

.github/workflows/testing.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ jobs:
248248
windows_tests:
249249
name: Windows tests
250250
runs-on: windows-latest
251-
timeout-minutes: 30
251+
timeout-minutes: 45
252252
env:
253253
NO_EXIT_CVE_NUM: 1
254254
PYTHONIOENCODING: 'utf8'
@@ -266,7 +266,7 @@ jobs:
266266
uses: actions/cache@v3
267267
with:
268268
path: ~/.cache/cve-bin-tool
269-
key: ${{ runner.os }}-cve-bin-tool-${{ steps.get-date.outputs.DATE }}
269+
key: linux-cve-bin-tool-${{ steps.get-date.outputs.DATE }}
270270
- name: Install cve-bin-tool
271271
run: |
272272
python -m pip install --upgrade pip
@@ -298,7 +298,7 @@ jobs:
298298
windows_long_tests:
299299
name: Windows long tests
300300
runs-on: windows-latest
301-
timeout-minutes: 50
301+
timeout-minutes: 60
302302
env:
303303
LONG_TESTS: 1
304304
NO_EXIT_CVE_NUM: 1
@@ -317,7 +317,7 @@ jobs:
317317
uses: actions/cache@v3
318318
with:
319319
path: ~/.cache/cve-bin-tool
320-
key: ${{ runner.os }}-cve-bin-tool-${{ steps.get-date.outputs.DATE }}
320+
key: linux-cve-bin-tool-${{ steps.get-date.outputs.DATE }}
321321
- name: Install cve-bin-tool
322322
run: |
323323
python -m pip install --upgrade pip
@@ -376,4 +376,5 @@ jobs:
376376
files: ./coverage.xml
377377
flags: win-longtests
378378
name: codecov-umbrella
379-
fail_ci_if_error: false
379+
fail_ci_if_error: false
380+

README.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
99
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
1010
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5380/badge)](https://bestpractices.coreinfrastructure.org/projects/5380)
11-
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/intel/cve-bin-tool.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/intel/cve-bin-tool/context:python)
1211

1312
The CVE Binary Tool is a free, open source tool to help you find known vulnerabilities in software, using data from the [National Vulnerability Database](https://nvd.nist.gov/) (NVD) list of [Common Vulnerabilities and Exposures](<https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures#:~:text=Common%20Vulnerabilities%20and%20Exposures%20(CVE)%20is%20a%20dictionary%20of%20common,publicly%20known%20information%20security%20vulnerabilities.>) (CVEs).
1413

1514
The tool has two main modes of operation:
1615

17-
1. A binary scanner which helps you determine which packages may have been included as part of a piece of software. There are <!-- NUMBER OF CHECKERS START-->250<!--NUMBER OF CHECKERS END--> checkers which focus on common, vulnerable open source components such as openssl, libpng, libxml2 and expat.
16+
1. A binary scanner which helps you determine which packages may have been included as part of a piece of software. There are <!-- NUMBER OF CHECKERS START-->251<!--NUMBER OF CHECKERS END--> checkers which focus on common, vulnerable open source components such as openssl, libpng, libxml2 and expat.
1817
2. Tools for scanning known component lists in various formats, including .csv, several linux distribution package lists, language specific package scanners and several Software Bill of Materials (SBOM) formats.
1918

2019
It is intended to be used as part of your continuous integration system to enable regular vulnerability scanning and give you early warning of known issues in your supply chain.
@@ -310,43 +309,43 @@ The following checkers are available for finding components in binary files:
310309

311310
<!--CHECKERS TABLE BEGIN-->
312311
| | | | Available checkers | | | |
313-
|--------------- |------------- |------------------ |----------------- |---------------- |--------------- |------------ |
312+
|--------------- |--------------- |------------------ |------------ |----------------- |---------------- |--------------- |
314313
| accountsservice |acpid |apache_http_server |apcupsd |asn1c |assimp |asterisk |
315314
| atftp |avahi |bash |bind |binutils |bird |bison |
316315
| boinc |bolt |bro |bubblewrap |busybox |bzip2 |c_ares |
317-
| chess |chrony |clamav |collectd |commons_compress |connman |cronie |
318-
| cryptsetup |cups |curl |cvs |darkhttpd |davfs2 |dbus |
319-
| dhcpcd |dnsmasq |domoticz |dovecot |doxygen |dpkg |dropbear |
320-
| e2fsprogs |elfutils |enscript |exim |exiv2 |expat |faad2 |
321-
| fastd |ffmpeg |file |firefox |flac |freeradius |freerdp |
322-
| fribidi |ftp |gcc |gdb |gimp |git |glib |
323-
| glibc |gmp |gnomeshell |gnupg |gnutls |gpgme |gpsd |
324-
| graphicsmagick |grub2 |gstreamer |gupnp |gvfs |haproxy |haserl |
325-
| hdf5 |hostapd |hunspell |i2pd |icecast |icu |iperf3 |
326-
| ipsec_tools |iptables |irssi |iucode_tool |jack2 |jacksondatabind |janus |
327-
| jhead |json_c |kbd |keepalived |kerberos |kexectools |kubernetes |
328-
| lftp |libarchive |libbpg |libconfuse |libdb |libebml |libgcrypt |
329-
| libgit2 |libical |libinput |libjpeg |libjpeg_turbo |libksba |liblas |
330-
| libnss |libpcap |librsvg |librsync |libsamplerate |libseccomp |libsndfile |
331-
| libsolv |libsoup |libsrtp |libssh |libssh2 |libtiff |libtomcrypt |
332-
| libupnp |libvirt |libvncserver |libvorbis |libxslt |lighttpd |lldpd |
333-
| logrotate |lua |luajit |lynx |lz4 |mailx |mariadb |
334-
| mdadm |memcached |minicom |minidlna |miniupnpc |miniupnpd |mosquitto |
335-
| motion |mpv |mtr |mutt |mysql |nano |nbd |
336-
| ncurses |neon |nessus |netatalk |netpbm |nettle |nghttp2 |
337-
| nginx |nmap |node |ntp |ntpsec |open_vm_tools |openafs |
338-
| opencv |openjpeg |openldap |openssh |openssl |openswan |openvpn |
339-
| p7zip |pango |patch |pcsc_lite |perl |pigz |png |
340-
| polarssl_fedora |poppler |postgresql |ppp |privoxy |procps_ng |proftpd |
341-
| pspp |pure_ftpd |putty |python |qemu |qt |quagga |
342-
| radare2 |radvd |rdesktop |rsync |rsyslog |rtl_433 |rust |
343-
| samba |sane_backends |seahorse |shadowsocks_libev |snort |sofia_sip |spice |
344-
| sqlite |squashfs |squid |strongswan |stunnel |subversion |sudo |
345-
| suricata |sylpheed |syslogng |sysstat |systemd |tcpdump |thrift |
346-
| thttpd |thunderbird |timescaledb |tinyproxy |tor |tpm2_tss |transmission |
347-
| trousers |unbound |unixodbc |upx |util_linux |varnish |vsftpd |
348-
| webkitgtk |wget |wireshark |wolfssl |wpa_supplicant |xerces |xml2 |
349-
| xscreensaver |zeek |zlib |znc |zsh | | |
316+
| capnproto |chess |chrony |clamav |collectd |commons_compress |connman |
317+
| cronie |cryptsetup |cups |curl |cvs |darkhttpd |davfs2 |
318+
| dbus |dhcpcd |dnsmasq |domoticz |dovecot |doxygen |dpkg |
319+
| dropbear |e2fsprogs |elfutils |enscript |exim |exiv2 |expat |
320+
| faad2 |fastd |ffmpeg |file |firefox |flac |freeradius |
321+
| freerdp |fribidi |ftp |gcc |gdb |gimp |git |
322+
| glib |glibc |gmp |gnomeshell |gnupg |gnutls |gpgme |
323+
| gpsd |graphicsmagick |grub2 |gstreamer |gupnp |gvfs |haproxy |
324+
| haserl |hdf5 |hostapd |hunspell |i2pd |icecast |icu |
325+
| iperf3 |ipsec_tools |iptables |irssi |iucode_tool |jack2 |jacksondatabind |
326+
| janus |jhead |json_c |kbd |keepalived |kerberos |kexectools |
327+
| kubernetes |lftp |libarchive |libbpg |libconfuse |libdb |libebml |
328+
| libgcrypt |libgit2 |libical |libinput |libjpeg |libjpeg_turbo |libksba |
329+
| liblas |libnss |libpcap |librsvg |librsync |libsamplerate |libseccomp |
330+
| libsndfile |libsolv |libsoup |libsrtp |libssh |libssh2 |libtiff |
331+
| libtomcrypt |libupnp |libvirt |libvncserver |libvorbis |libxslt |lighttpd |
332+
| lldpd |logrotate |lua |luajit |lynx |lz4 |mailx |
333+
| mariadb |mdadm |memcached |minicom |minidlna |miniupnpc |miniupnpd |
334+
| mosquitto |motion |mpv |mtr |mutt |mysql |nano |
335+
| nbd |ncurses |neon |nessus |netatalk |netpbm |nettle |
336+
| nghttp2 |nginx |nmap |node |ntp |ntpsec |open_vm_tools |
337+
| openafs |opencv |openjpeg |openldap |openssh |openssl |openswan |
338+
| openvpn |p7zip |pango |patch |pcsc_lite |perl |pigz |
339+
| png |polarssl_fedora |poppler |postgresql |ppp |privoxy |procps_ng |
340+
| proftpd |pspp |pure_ftpd |putty |python |qemu |qt |
341+
| quagga |radare2 |radvd |rdesktop |rsync |rsyslog |rtl_433 |
342+
| rust |samba |sane_backends |seahorse |shadowsocks_libev |snort |sofia_sip |
343+
| spice |sqlite |squashfs |squid |strongswan |stunnel |subversion |
344+
| sudo |suricata |sylpheed |syslogng |sysstat |systemd |tcpdump |
345+
| thrift |thttpd |thunderbird |timescaledb |tinyproxy |tor |tpm2_tss |
346+
| transmission |trousers |unbound |unixodbc |upx |util_linux |varnish |
347+
| vsftpd |webkitgtk |wget |wireshark |wolfssl |wpa_supplicant |xerces |
348+
| xml2 |xscreensaver |zeek |zlib |znc |zsh | |
350349
<!--CHECKERS TABLE END-->
351350

352351
All the checkers can be found in the checkers directory, as can the
@@ -453,9 +452,10 @@ On windows systems, you may need:
453452
- `Expand`
454453
- `pdftotext`
455454

456-
Windows has `ar` and `Expand` installed by default, but `7z` in particular might need to be installed.
455+
Windows has `Expand` installed by default, but `ar` and `7z` might need to be installed.
457456
If you want to run our test-suite or scan a zstd compressed file, We recommend installing this [7-zip-zstd](https://github.com/mcmilk/7-Zip-zstd)
458457
fork of 7zip. We are currently using `7z` for extracting `jar`, `apk`, `msi`, `exe` and `rpm` files.
458+
To install `ar` you can install MinGW (which has binutils as a part of it) from [here](https://www.mingw-w64.org/downloads/#msys2) and run the downloaded .exe file.
459459

460460
If you get an error about building libraries when you try to install from pip,
461461
you may need to install the Windows build tools. The Windows build tools are

cve_bin_tool/checkers/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"busybox",
3535
"bzip2",
3636
"c_ares",
37+
"capnproto",
3738
"chess",
3839
"chrony",
3940
"clamav",
@@ -149,6 +150,7 @@
149150
"logrotate",
150151
"lua",
151152
"luajit",
153+
"lxc",
152154
"lynx",
153155
"lz4",
154156
"mailx",
@@ -166,6 +168,7 @@
166168
"mutt",
167169
"mysql",
168170
"nano",
171+
"nasm",
169172
"nbd",
170173
"ncurses",
171174
"neon",
@@ -318,7 +321,7 @@ def guess_contains(self, lines):
318321
def get_version(self, lines, filename):
319322
version_info = dict()
320323

321-
if any(pattern.search(filename) for pattern in self.FILENAME_PATTERNS):
324+
if any(pattern.match(filename) for pattern in self.FILENAME_PATTERNS):
322325
version_info["is_or_contains"] = "is"
323326

324327
if "is_or_contains" not in version_info and self.guess_contains(lines):

cve_bin_tool/checkers/capnproto.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (C) 2023 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for capnproto:
7+
8+
https://www.cvedetails.com/product/37224/Capnproto-Capnproto.html?vendor_id=16364
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class CapnprotoChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [
20+
r"Cap'n Proto version ([0-9]+\.[0-9]+\.[0-9]+)",
21+
r"libcapnp-([0-9]+\.[0-9]+\.[0-9]+)",
22+
]
23+
VENDOR_PRODUCT = [("capnproto", "capnproto")]

cve_bin_tool/checkers/gstreamer.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Copyright (C) 2021 Intel Corporation
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

4-
# !/usr/bin/env python3
54
"""
65
CVE checker for Gstreamer
76
87
References:
98
https://www.cvedetails.com/vulnerability-list/vendor_id-9481/Gstreamer.html
9+
https://www.cvedetails.com/product/35669/Gstreamer-Project-Gstreamer.html?vendor_id=16047
1010
"""
1111
from cve_bin_tool.checkers import Checker
1212

@@ -16,5 +16,9 @@ class GstreamerChecker(Checker):
1616
r"http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer",
1717
]
1818
FILENAME_PATTERNS = [r"gstreamer"]
19-
VERSION_PATTERNS = [r"libgstreamer-((\d+\.)+\d+)"]
20-
VENDOR_PRODUCT = [("gstreamer_project", "gstreamer")]
19+
VERSION_PATTERNS = [
20+
r"((\d+\.)+\d+)[a-zA-Z \r\n]*GStreamer ",
21+
r"gstreamer[a-zA-Z \r\n]*((\d+\.)+\d+)",
22+
r"libgstreamer-((\d+\.)+\d+)",
23+
]
24+
VENDOR_PRODUCT = [("gstreamer", "gstreamer"), ("gstreamer_project", "gstreamer")]

cve_bin_tool/checkers/icecast.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
CVE checker for icecast
77
88
https://www.cvedetails.com/product/1194/Icecast-Icecast.html?vendor_id=693
9+
https://www.cvedetails.com/product/31619/Xiph-Icecast.html?vendor_id=7966
910
1011
"""
1112
from __future__ import annotations
@@ -17,4 +18,4 @@ class IcecastChecker(Checker):
1718
CONTAINS_PATTERNS: list[str] = []
1819
FILENAME_PATTERNS = [r"icecast"]
1920
VERSION_PATTERNS = [r"Icecast ([0-9]+\.[0-9]+\.[0-9]+)"]
20-
VENDOR_PRODUCT = [("icecast", "icecast")]
21+
VENDOR_PRODUCT = [("icecast", "icecast"), ("xiph", "icecast")]

cve_bin_tool/checkers/libarchive.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""
66
CVE checker for libarchive
77
8+
https://www.cvedetails.com/product/11632/Freebsd-Libarchive.html?vendor_id=6
89
https://www.cvedetails.com/product/26168/Libarchive-Libarchive.html?vendor_id=12872
910
1011
"""
@@ -17,4 +18,4 @@ class LibarchiveChecker(Checker):
1718
CONTAINS_PATTERNS: list[str] = []
1819
FILENAME_PATTERNS = [r"libarchive.so"]
1920
VERSION_PATTERNS = [r"libarchive ([0-9]+\.[0-9]+\.[0-9]+)"]
20-
VENDOR_PRODUCT = [("libarchive", "libarchive")]
21+
VENDOR_PRODUCT = [("freebsd", "libarchive"), ("libarchive", "libarchive")]

cve_bin_tool/checkers/libjpeg_turbo.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44

55
"""
6-
CVE checker for libjpg-turbo
6+
CVE checker for libjpeg-turbo
77
88
References:
9+
https://www.cvedetails.com/product/22813/D.r.commander-Libjpeg-turbo.html?vendor_id=12120
910
https://www.cvedetails.com/vulnerability-list/vendor_id-17075/product_id-40849/Libjpeg-turbo-Libjpeg-turbo.html
1011
"""
1112
from cve_bin_tool.checkers import Checker
@@ -18,9 +19,8 @@ class LibjpegTurboChecker(Checker):
1819
r"Invalid JPEG file structure: two SOF markers",
1920
]
2021
FILENAME_PATTERNS = [r"libjpg.so."]
21-
VERSION_PATTERNS = [
22-
r"libjpeg-turbo version ([0-9]\.[0-9]\.[0-9])",
23-
r"LIBJPEGTURBO_([0-9]+\.[0-9]+\.?[0-9]?)",
24-
r"LIBJPEG_([0-9]+\.[0-9]+\.?[0-9]?)",
22+
VERSION_PATTERNS = [r"libjpeg-turbo version ([0-9]\.[0-9]\.[0-9])"]
23+
VENDOR_PRODUCT = [
24+
("d.r.commander", "libjpeg-turbo"),
25+
("libjpeg-turbo", "libjpeg-turbo"),
2526
]
26-
VENDOR_PRODUCT = [("libjpeg-turbo", "libjpeg-turbo")]

cve_bin_tool/checkers/lxc.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (C) 2023 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for lxc
7+
8+
https://www.cvedetails.com/product/27105/Linuxcontainers-LXC.html?vendor_id=13134
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class LxcChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [r"([0-9]+\.[0-9]+\.[0-9]+)[a-zA-Z:./ %\r\n]*lxc"]
20+
VENDOR_PRODUCT = [("linuxcontainers", "lxc")]

cve_bin_tool/checkers/nasm.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (C) 2022 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for nasm:
7+
8+
https://www.cvedetails.com/product/14272/Nasm-Netwide-Assembler.html?vendor_id=2638
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class NasmChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [r"NASM ([0-9]+\.[0-9]+\.[0-9]+)"]
20+
VENDOR_PRODUCT = [("nasm", "netwide_assembler")]

cve_bin_tool/checkers/openjpeg.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66
CVE checker for openjpeg
77
8-
https://www.cvedetails.com/product/22664/Openjpeg-Openjpeg.html?vendor_id=12064
8+
https://www.cvedetails.com/product/50039/Uclouvain-Openjpeg.html?vendor_id=19248
99
1010
"""
1111
from . import Checker
@@ -26,5 +26,6 @@ class OpenjpegChecker(Checker):
2626
]
2727
VERSION_PATTERNS = [
2828
r"openjpeg-([0-9]+\.[0-9]+\.[0-9]+)",
29+
r"openjpeg2-([0-9]+\.[0-9]+\.[0-9]+)",
2930
]
30-
VENDOR_PRODUCT = [("openjpeg", "openjpeg")]
31+
VENDOR_PRODUCT = [("uclouvain", "openjpeg")]

cve_bin_tool/checkers/sqlite.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ class SqliteChecker(Checker):
6161
VENDOR_PRODUCT = [("sqlite", "sqlite")]
6262
VERSION_PATTERNS = [
6363
r"Id: SQLite version (\d+\.\d+\.\d+)",
64-
r"sqlite(\d+)\.debug",
65-
] # patterns like the second one aren't ideal (check the end of the file)
64+
r"(\d{4}-\d{2}-\d{2} \d+:\d+:\d+ [\w]+)\r?\n(?:SQLite|SQLITE|DESC)",
65+
]
6666
FILENAME_PATTERNS = [r"sqlite", r"sqlite3"]
6767

6868
mapdb = VersionSignatureDb("sqlite", get_version_map, 30)
@@ -90,7 +90,6 @@ def get_version(self, lines, filename):
9090
9191
The most correct way to do this is to search for the sha1 sums per release.
9292
Fedora rpms have a simpler SQLite version string.
93-
If neither of those work, try to at least guess the major version
9493
"""
9594

9695
version_info = super().get_version(lines, filename)
@@ -105,10 +104,3 @@ def get_version(self, lines, filename):
105104
version_info["version"] = mapping[0]
106105

107106
return version_info
108-
109-
110-
"""
111-
Using filenames (containing patterns like '.so' etc.) in the binaries as VERSION_PATTERNS aren't ideal.
112-
The reason behind this is that these might depend on who packages the file (like it
113-
might work on fedora but not on ubuntu)
114-
"""

0 commit comments

Comments
 (0)