CVE-2022-3358
openssl: Using a Custom Cipher with NID_undef may lead to NULL encryption
Overview
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).
Source: OX vulnerability database
Severity
7.5 · HIGH
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- None
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Weakness: CWE-476
Affected packages · 2
| Ecosystem | Package | Vulnerable | Fixed in |
|---|---|---|---|
| Cargo (Rust) | openssl-src | >=300.0.0, <300.0.10 | 300.0.10 |
| Conan (C/C++) | openssl | >=3.0.0 <3.0.6 | 3.0.12 |
Open a package to see all its vulnerabilities.
Operating systems · 26 fixes
Oracle Linux 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 9 | openssl +3 | 1:3.0.7-6.0.1.el9_2 |
Photon OS 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 4.0 | openssl +4 | 3.0.6-1.ph4 |
Red Hat 2 releases · 2 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 7 | aavmf +6 | eol | — |
| 9 | openssl +3 | 1:3.0.7-6.el9_2 | RHSA-2023:2523 |
SUSE Linux Enterprise 1 release · 1 package
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 15.4 | libopenssl-3-devel +2 | 3.0.1-150400.4.11.1 | SUSE-SU-2022:3843-1 |
alma 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 9 | openssl +3 | 1:3.0.7-6.el9_2 |
alpine 4 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 3.22 | openssl | 3.0.6-r0 |
| 3.23 | openssl | 3.0.6-r0 |
| 3.24 | openssl | 3.0.6-r0 |
| edge | openssl | 3.0.6-r0 |
amazon linux 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 2023 | openssl +6 | 1:3.0.8-1.amzn2023.0.1 |
chainguard 1 release · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| ruby-3-1 | not affected | |
| openssl | 3.0.7-r0 |
debian 3 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 12 | openssl | 3.0.7-1 |
| 13 | openssl | 3.0.7-1 |
| 14 | openssl | 3.0.7-1 |
echo 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| openssl | 3.0.7-1 |
openSUSE 1 release · 1 package
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Tumbleweed | libopenssl-3-devel +5 | 3.0.7-1.1 | openSUSE-SU-2024:12475-1 |
root.io alpine 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 3.23 | rootio-openssl | 3.0.6-r0 |
root.io debian 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 12 | rootio-openssl | 3.0.7-1 |
seal debian 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| openssl +1 | 1.1.1w-0+deb11u2+sp999 |
ubuntu 3 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 22.04 | openssl | 3.0.2-0ubuntu1.7 |
| 24.04 | openssl | 3.0.5-2ubuntu2 |
| 26.04 | openssl | 3.0.5-2ubuntu2 |
wolfi 1 release · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| ruby-3-1 | not affected | |
| openssl | 3.0.7-r0 |
References
- access.redhat.com https://access.redhat.com/errata/RHSA-2023:2523
- access.redhat.com https://access.redhat.com/security/cve/CVE-2022-3358
- bugzilla.redhat.com https://bugzilla.redhat.com/2134740
- errata.almalinux.org https://errata.almalinux.org/9/ALSA-2023-2523.html
- git.openssl.org https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=5485c56679d7c49b96e8fc8ca708b0b7e7c03c4b
- git.openssl.org https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=5485c56679d7c49b96e8fc8ca708b0b7e7c03c4b
- github.com https://github.com/alexcrichton/openssl-src-rs
- linux.oracle.com https://linux.oracle.com/cve/CVE-2022-3358.html
- linux.oracle.com https://linux.oracle.com/errata/ELSA-2023-2523.html
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2022-3358
Show all 18 references
- psirt.global.sonicwall.com https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2022-0023
- rustsec.org https://rustsec.org/advisories/RUSTSEC-2022-0059.html
- security.gentoo.org https://security.gentoo.org/glsa/202402-08
- security.netapp.com https://security.netapp.com/advisory/ntap-20221028-0014
- security.netapp.com https://security.netapp.com/advisory/ntap-20221028-0014/
- ubuntu.com https://ubuntu.com/security/notices/USN-5710-1
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2022-3358
- www.openssl.org https://www.openssl.org/news/secadv/20221011.txt
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.