Skip to content

Commit 79e714a

Browse files
remove openssl.py from PR. see PR intel#5174
update python.py checker, improve VERSION_PAEETERNS format for PE info. fix balck format issue. update extract_version_from_pe to output valid format info.
2 parents 515dc77 + d7a69a6 commit 79e714a

21 files changed

+271
-131
lines changed

.github/actions/spelling/allow.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ c
7474
cabextract
7575
cairo
7676
capnproto
77+
captive
7778
cbt
7879
CDNs
7980
CDX
@@ -584,6 +585,7 @@ pocoo
584585
polarssl
585586
poppler
586587
populatedb
588+
portal
587589
postgresql
588590
ppp
589591
Prajwal

.github/workflows/update-cache.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Update database
5353
run: |
5454
[[ -e cache ]] && mkdir -p .cache && mv cache ~/.cache/cve-bin-tool
55-
python -m cve_bin_tool.cli test/assets/test-kerberos-5-1.15.1.out -u now
55+
python -m cve_bin_tool.cli -d OSV test/assets/test-kerberos-5-1.15.1.out -u now
5656
python -m cve_bin_tool.mismatch_loader
5757
cp -r ~/.cache/cve-bin-tool cache
5858

README.md

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CVE Binary Tool uses the NVD API but is not endorsed or certified by the NVD.
1616

1717
The tool has two main modes of operation:
1818

19-
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-->409<!--NUMBER OF CHECKERS END--> checkers. Our initial focus was on common, vulnerable open source components such as openssl, libpng, libxml2 and expat.
19+
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-->410<!--NUMBER OF CHECKERS END--> checkers. Our initial focus was on common, vulnerable open source components such as openssl, libpng, libxml2 and expat.
2020

2121
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.
2222

@@ -226,66 +226,66 @@ The following checkers are available for finding components in binary files:
226226

227227
<!--CHECKERS TABLE BEGIN-->
228228
| | | | Available checkers | | | |
229-
|--------------- |-------------- |------------------ |---------------- |-------------- |--------------- |----------------- |
229+
|----------------- |--------------- |------------------ |------------- |---------------- |-------------- |--------------- |
230230
| accountsservice |acpid |apache_http_server |apcupsd |apparmor |apr |asn1c |
231231
| assimp |asterisk |atftp |augeas |avahi |axel |bash |
232232
| bind |binutils |bird |bison |bluez |boa |boinc |
233233
| botan |bro |bubblewrap |busybox |bwm_ng |bzip2 |c_ares |
234-
| cairo |capnproto |ceph |cflow |chess |chrony |civetweb |
235-
| clamav |clang |collectd |commons_compress |connman |coreutils |cpio |
236-
| cpp_httplib |cronie |cryptsetup |cups |cups_filters |curl |cvs |
237-
| darkhttpd |dav1d |davfs2 |dbus |debianutils |dhclient |dhcpcd |
238-
| dhcpd |djvulibre |dlt_daemon |dmidecode |dnsmasq |docker |domoticz |
239-
| dosfstools |dotnet |dovecot |doxygen |dpkg |dropbear |e2fsprogs |
240-
| ed |elfutils |emacs |enscript |exfatprogs |exim |exiv2 |
241-
| f2fs_tools |faad2 |fastd |ffmpeg |file |firefox |firejail |
242-
| flac |fluidsynth |freeradius |freerdp |fribidi |frr |fuse |
243-
| gawk |gcc |gdal |gdb |gdk_pixbuf |gettext |ghostscript |
244-
| gimp |git |glib |glibc |gmp |gnomeshell |gnupg |
245-
| gnutls |go |gpgme |gpsd |graphicsmagick |grep |grub2 |
246-
| gsasl |gstreamer |guile |gupnp |gvfs |gzip |haproxy |
247-
| harfbuzz |haserl |hdf5 |heimdal |hostapd |hunspell |hwloc |
248-
| i2pd |icecast |icu |imagemagick |indent |inetutils |iperf3 |
249-
| ipmitool |ipsec_tools |iptables |irssi |iucode_tool |iwd |jack2 |
250-
| jacksondatabind |janus |jasper |jbig |jhead |jq |json_c |
251-
| kbd |keepalived |kerberos |kexectools |kodi |kubernetes |ldns |
252-
| lftp |libarchive |libass |libbpg |libcap |libcoap |libconfuse |
253-
| libcurl |libdb |libde265 |libebml |libevent |libexpat |libgcrypt |
254-
| libgd |libgit2 |libheif |libical |libidn2 |libinput |libjpeg |
255-
| libjpeg_turbo |libksba |liblas |liblouis |libmatroska |libmemcached |libmicrohttpd |
256-
| libmodbus |libnss |libopenmpt |libpcap |libraw |libreoffice |libreswan |
257-
| librsvg |librsync |libsamplerate |libseccomp |libsndfile |libsolv |libsoup |
258-
| libsrtp |libssh |libssh2 |libtasn1 |libtiff |libtomcrypt |libupnp |
259-
| libuv |libvips |libvirt |libvncserver |libvorbis |libvpx |libxslt |
260-
| libyaml |libyang |lighttpd |linux_kernel |linuxptp |lldpd |llvm |
261-
| logrotate |lrzip |lua |luajit |lxc |lynx |lz4 |
262-
| lzo2 |mailx |mariadb |mbedtls |mdadm |memcached |micropython |
263-
| minetest |mini_httpd |minicom |minidlna |miniupnpc |miniupnpd |moby |
264-
| modsecurity |monit |mosquitto |motion |mp4v2 |mpg123 |mpv |
265-
| msmtp |mtr |mupdf |musl |mutt |mysql |nano |
266-
| nasm |nbd |ncurses |neon |nessus |netatalk |netdata |
267-
| netkit_ftp |netpbm |nettle |nghttp2 |nginx |ngircd |nmap |
268-
| node |ntfs_3g |ntp |ntpsec |oath_toolkit |ofono |open_iscsi |
269-
| open_vm_tools |openafs |openblas |opencv |openjpeg |openldap |opensc |
270-
| openssh |openssl |openswan |openvpn |openvswitch |orc |p7zip |
271-
| pango |patch |pcre |pcre2 |pcsc_lite |perl |php |
272-
| picocom |pigz |pixman |pjsip |png |polarssl_fedora |poppler |
273-
| postgresql |ppp |privoxy |procps_ng |proftpd |protobuf_c |pspp |
274-
| pure_ftpd |putty |python |qemu |qpdf |qt |quagga |
275-
| radare2 |radvd |raptor |rauc |rdesktop |readline |redis |
276-
| rpm |rsync |rsyslog |rtl_433 |rtmpdump |ruby |runc |
277-
| rust |samba |sane_backends |sasl |sdl |seahorse |shadowsocks_libev |
278-
| snapd |sngrep |snort |socat |sofia_sip |speex |spice |
279-
| sqlite |squashfs |squid |sslh |stellarium |strongswan |stunnel |
280-
| subversion |sudo |suricata |sylpheed |syslogng |sysstat |systemd |
281-
| tar |tbb |tcpdump |tcpreplay |terminology |tesseract |thrift |
282-
| thttpd |thunderbird |timescaledb |tinyproxy |tor |toybox |tpm2_tss |
283-
| traceroute |transmission |trousers |ttyd |twonky_server |u_boot |udisks |
284-
| unbound |unixodbc |upx |util_linux |uwsgi |varnish |vim |
285-
| vlc |vorbis_tools |vsftpd |wavpack |webkitgtk |wget |wireshark |
286-
| wolfssl |wpa_supplicant |xerces |xml2 |xpdf |xscreensaver |xwayland |
287-
| xz |yasm |zabbix |zbar |zchunk |zeek |zlib |
288-
| znc |zsh |zstandard | | | | |
234+
| cairo |capnproto |captive_portal |ceph |cflow |chess |chrony |
235+
| civetweb |clamav |clang |collectd |commons_compress |connman |coreutils |
236+
| cpio |cpp_httplib |cronie |cryptsetup |cups |cups_filters |curl |
237+
| cvs |darkhttpd |dav1d |davfs2 |dbus |debianutils |dhclient |
238+
| dhcpcd |dhcpd |djvulibre |dlt_daemon |dmidecode |dnsmasq |docker |
239+
| domoticz |dosfstools |dotnet |dovecot |doxygen |dpkg |dropbear |
240+
| e2fsprogs |ed |elfutils |emacs |enscript |exfatprogs |exim |
241+
| exiv2 |f2fs_tools |faad2 |fastd |ffmpeg |file |firefox |
242+
| firejail |flac |fluidsynth |freeradius |freerdp |fribidi |frr |
243+
| fuse |gawk |gcc |gdal |gdb |gdk_pixbuf |gettext |
244+
| ghostscript |gimp |git |glib |glibc |gmp |gnomeshell |
245+
| gnupg |gnutls |go |gpgme |gpsd |graphicsmagick |grep |
246+
| grub2 |gsasl |gstreamer |guile |gupnp |gvfs |gzip |
247+
| haproxy |harfbuzz |haserl |hdf5 |heimdal |hostapd |hunspell |
248+
| hwloc |i2pd |icecast |icu |imagemagick |indent |inetutils |
249+
| iperf3 |ipmitool |ipsec_tools |iptables |irssi |iucode_tool |iwd |
250+
| jack2 |jacksondatabind |janus |jasper |jbig |jhead |jq |
251+
| json_c |kbd |keepalived |kerberos |kexectools |kodi |kubernetes |
252+
| ldns |lftp |libarchive |libass |libbpg |libcap |libcoap |
253+
| libconfuse |libcurl |libdb |libde265 |libebml |libevent |libexpat |
254+
| libgcrypt |libgd |libgit2 |libheif |libical |libidn2 |libinput |
255+
| libjpeg |libjpeg_turbo |libksba |liblas |liblouis |libmatroska |libmemcached |
256+
| libmicrohttpd |libmodbus |libnss |libopenmpt |libpcap |libraw |libreoffice |
257+
| libreswan |librsvg |librsync |libsamplerate |libseccomp |libsndfile |libsolv |
258+
| libsoup |libsrtp |libssh |libssh2 |libtasn1 |libtiff |libtomcrypt |
259+
| libupnp |libuv |libvips |libvirt |libvncserver |libvorbis |libvpx |
260+
| libxslt |libyaml |libyang |lighttpd |linux_kernel |linuxptp |lldpd |
261+
| llvm |logrotate |lrzip |lua |luajit |lxc |lynx |
262+
| lz4 |lzo2 |mailx |mariadb |mbedtls |mdadm |memcached |
263+
| micropython |minetest |mini_httpd |minicom |minidlna |miniupnpc |miniupnpd |
264+
| moby |modsecurity |monit |mosquitto |motion |mp4v2 |mpg123 |
265+
| mpv |msmtp |mtr |mupdf |musl |mutt |mysql |
266+
| nano |nasm |nbd |ncurses |neon |nessus |netatalk |
267+
| netdata |netkit_ftp |netpbm |nettle |nghttp2 |nginx |ngircd |
268+
| nmap |node |ntfs_3g |ntp |ntpsec |oath_toolkit |ofono |
269+
| open_iscsi |open_vm_tools |openafs |openblas |opencv |openjpeg |openldap |
270+
| opensc |openssh |openssl |openswan |openvpn |openvswitch |orc |
271+
| p7zip |pango |patch |pcre |pcre2 |pcsc_lite |perl |
272+
| php |picocom |pigz |pixman |pjsip |png |polarssl_fedora |
273+
| poppler |postgresql |ppp |privoxy |procps_ng |proftpd |protobuf_c |
274+
| pspp |pure_ftpd |putty |python |qemu |qpdf |qt |
275+
| quagga |radare2 |radvd |raptor |rauc |rdesktop |readline |
276+
| redis |rpm |rsync |rsyslog |rtl_433 |rtmpdump |ruby |
277+
| runc |rust |samba |sane_backends |sasl |sdl |seahorse |
278+
| shadowsocks_libev |snapd |sngrep |snort |socat |sofia_sip |speex |
279+
| spice |sqlite |squashfs |squid |sslh |stellarium |strongswan |
280+
| stunnel |subversion |sudo |suricata |sylpheed |syslogng |sysstat |
281+
| systemd |tar |tbb |tcpdump |tcpreplay |terminology |tesseract |
282+
| thrift |thttpd |thunderbird |timescaledb |tinyproxy |tor |toybox |
283+
| tpm2_tss |traceroute |transmission |trousers |ttyd |twonky_server |u_boot |
284+
| udisks |unbound |unixodbc |upx |util_linux |uwsgi |varnish |
285+
| vim |vlc |vorbis_tools |vsftpd |wavpack |webkitgtk |wget |
286+
| wireshark |wolfssl |wpa_supplicant |xerces |xml2 |xpdf |xscreensaver |
287+
| xwayland |xz |yasm |zabbix |zbar |zchunk |zeek |
288+
| zlib |znc |zsh |zstandard | | | |
289289
<!--CHECKERS TABLE END-->
290290

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

cve_bin_tool/checkers/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"commons_compress",
6666
"connman",
6767
"coreutils",
68+
"corosync",
6869
"cpio",
6970
"cpp_httplib",
7071
"cronie",
@@ -396,6 +397,7 @@
396397
"toybox",
397398
"tpm2_tss",
398399
"traceroute",
400+
"traffic_server",
399401
"transmission",
400402
"trousers",
401403
"ttyd",
@@ -433,6 +435,7 @@
433435
"znc",
434436
"zsh",
435437
"zstandard",
438+
"zziplib",
436439
]
437440

438441
VendorProductPair = collections.namedtuple("VendorProductPair", ["vendor", "product"])

cve_bin_tool/checkers/corosync.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for corosync
7+
8+
https://www.cvedetails.com/product/27835/Corosync-Corosync.html?vendor_id=13388
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class CorosyncChecker(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]*corosync"]
20+
VENDOR_PRODUCT = [("corosync", "corosync")]

cve_bin_tool/checkers/openssl.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ class OpensslChecker(Checker):
1818
CONTAINS_PATTERNS = [r"part of OpenSSL", r"openssl.cnf", r"-DOPENSSL_"]
1919
FILENAME_PATTERNS = [r"libssl.so.", r"libcrypto.so"]
2020
VERSION_PATTERNS = [
21-
# for general format: OpenSSL 1.0.2u¡BOpenSSL 3.0.0¡BOpenSSL 1.1.1k
22-
r"OpenSSL\s+([0-9]+\.[0-9]+\.[0-9]+[a-z]*)",
23-
2421
r"OpenSSL ([0-9]+\.[0-9]+\.[0-9]+[a-z]*) [a-zA-Z0-9 ]+\r?\n(?:%s \(Library: %s\)|[a-zA-Z0-9:,_ \.\-\r\n]*OPENSSLDIR|ssl)",
2522
r"(?:%s \(Library: %s\)\r?\n|OPENSSLDIR[a-zA-Z0-9:/ \"\-\r\n]*)OpenSSL ([0-9]+\.[0-9]+\.[0-9]+[a-z]*) [a-zA-Z0-9 ]+",
2623
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for traffic_server
7+
8+
https://www.cvedetails.com/product/19990/Apache-Traffic-Server.html?vendor_id=45
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class TrafficServerChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [r"Traffic Server ([0-9]+\.[0-9]+\.[0-9]+)"]
20+
VENDOR_PRODUCT = [("apache", "traffic_server")]

cve_bin_tool/checkers/zziplib.py

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

cve_bin_tool/data_sources/nvd_source.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ class NVD_Source(Data_Source):
4949
CACHEDIR = DISK_LOCATION_DEFAULT
5050
BACKUPCACHEDIR = DISK_LOCATION_BACKUP
5151
FEED_NVD = "https://nvd.nist.gov/vuln/data-feeds"
52-
FEED_MIRROR = "https://mirror.cveb.in/nvd/json/cve/1.1"
52+
FEED_MIRROR = "https://v4.mirror.cveb.in/nvd/json/cve/1.1"
5353
LOGGER = LOGGER.getChild("CVEDB")
5454
NVDCVE_FILENAME_TEMPLATE = NVD_FILENAME_TEMPLATE
5555
META_LINK_NVD = "https://nvd.nist.gov"
56-
META_LINK_MIRROR = "https://mirror.cveb.in/nvd/json/cve/1.1"
56+
META_LINK_MIRROR = "https://v4.mirror.cveb.in/nvd/json/cve/1.1"
5757
META_REGEX_NVD = re.compile(r"feeds\/json\/.*-[0-9]*\.[0-9]*-[0-9]*\.meta")
5858
META_REGEX_MIRROR = re.compile(r"nvdcve-[0-9]*\.[0-9]*-[0-9]*\.meta")
5959
RANGE_UNSET = ""
@@ -583,17 +583,20 @@ async def cache_update(
583583
if len(gzip_data) == 0:
584584
self.LOGGER.debug(f"Missing data for {filename}")
585585
return
586-
json_data = gzip.decompress(gzip_data)
587-
gotsha = hashlib.sha256(json_data).hexdigest().upper()
588-
async with FileIO(filepath, "wb") as filepath_handle:
589-
await filepath_handle.write(gzip_data)
590-
# Raise error if there was an issue with the sha
591-
if gotsha != sha:
592-
# Remove the file if there was an issue
593-
# exit(100)
594-
filepath.unlink()
595-
with ErrorHandler(mode=self.error_mode, logger=self.LOGGER):
596-
raise SHAMismatch(f"{url} (have: {gotsha}, want: {sha})")
586+
try:
587+
json_data = gzip.decompress(gzip_data)
588+
gotsha = hashlib.sha256(json_data).hexdigest().upper()
589+
async with FileIO(filepath, "wb") as filepath_handle:
590+
await filepath_handle.write(gzip_data)
591+
# Raise error if there was an issue with the sha
592+
if gotsha != sha:
593+
# Remove the file if there was an issue
594+
# exit(100)
595+
filepath.unlink()
596+
with ErrorHandler(mode=self.error_mode, logger=self.LOGGER):
597+
raise SHAMismatch(f"{url} (have: {gotsha}, want: {sha})")
598+
except Exception:
599+
self.LOGGER.warning(f"Invalid data in {filename}, skipping")
597600

598601
def load_nvd_year(self, year: int) -> dict[str, str | object]:
599602
"""
@@ -621,3 +624,5 @@ def nvd_years(self) -> list[int]:
621624
int(filename.split(".")[-3].split("-")[-1])
622625
for filename in glob.glob(str(Path(self.cachedir) / "nvdcve-1.1-*.json.gz"))
623626
)
627+
# FIXME: temporary workaround so we don't try to load bad year data
628+
# return list(range(2020, 2025))

cve_bin_tool/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from cve_bin_tool.log import LOGGER
99
from cve_bin_tool.util import make_http_requests
1010

11-
VERSION: str = "3.4.1rc0"
11+
VERSION: str = "3.4.1"
1212

1313
HTTP_HEADERS: dict = {
1414
"User-Agent": f"cve-bin-tool/{VERSION} (https://github.com/intel/cve-bin-tool/)",

0 commit comments

Comments
 (0)