CVE-2022-3358
Using a Custom Cipher with NID_undef may lead to NULL encryption
Check your servers for CVE-2022-3358
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2022-3358 affects openssl, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
OpenSSL supports creating a custom cipher via the legacy EVP_CIPHER_meth_new() function and associated function calls. This function was deprecated in OpenSSL 3.0 and application authors are instead encouraged to use the new provider mechanism in order to implement custom ciphers. OpenSSL versions 3.0.0 to 3.0.5 incorrectly handle legacy custom ciphers passed to the EVP_EncryptInit_ex2(), EVP_DecryptInit_ex2() and EVP_CipherInit_ex2() functions (as well as other similarly named encryption and decryption initialisation functions). Instead of using the custom cipher directly it incorrectly tries to fetch an equivalent cipher from the available providers. An equivalent cipher is found based on the NID passed to EVP_CIPHER_meth_new(). This NID is supposed to represent the unique NID for a given cipher. However it is possible for an application to incorrectly pass NID_undef as this value in the call to EVP_CIPHER_meth_new(). When NID_undef is used in this way the OpenSSL encryption/decryption initialisation function will match the NULL cipher as being equivalent and will fetch this from the available providers. This will succeed if the default provider has been loaded (or if a third party provider has been loaded that offers this cipher). Using the NULL cipher means that the plaintext is emitted as the ciphertext. Applications are only affected by this issue if they call EVP_CIPHER_meth_new() using NID_undef and subsequently use it in a call to an encryption/decryption initialisation function. Applications that only use SSL/TLS are not impacted by this issue. Fixed in OpenSSL 3.0.6 (Affected 3.0.0-3.0.5).
Exploitation
EPSS 4.04%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 90.8% of all scored CVEs. Scores of 1 Dec 2026.
Affected products
As the CNA lists them.
Is my server affected?
Find the installed version of openssl and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i openssl
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2022-3358 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2022-3358RHEL, Rocky, Alma, Fedora
rpm -q openssl
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2022-3358Alpine
apk list --installed | grep -i opensslWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2022-3358
trivy image --scanners vuln IMAGE | grep CVE-2022-3358
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- GLSA-202402-08 security.gentoo.org · vendor advisory
Other references
- https://www.openssl.org/news/secadv/20221011.txt openssl.org
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=5485c56679d7c49b96e8fc8ca708b0b7e7c03c4b git.openssl.org
- https://security.netapp.com/advisory/ntap-20221028-0014/ security.netapp.com
- https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2022-0023 psirt.global.sonicwall.com
Source: the record CVE-2022-3358 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse