// For flags

CVE-2022-3358

Using a Custom Cipher with NID_undef may lead to NULL encryption

Severity Score

7.5
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

0
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

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).

OpenSSL admite la creación de un cifrado personalizado por medio de la función EVP_CIPHER_meth_new() heredada y las llamadas a funciones asociadas. Esta función quedó obsoleta en OpenSSL versión 3.0 y, en su lugar, es alentado a autores de aplicaciones a usar el nuevo mecanismo de proveedores para implementar cifrados personalizados. Las versiones 3.0.0 a 3.0.5 de OpenSSL manejan incorrectamente los cifrados personalizados heredados pasados a las funciones EVP_EncryptInit_ex2(), EVP_DecryptInit_ex2() y EVP_CipherInit_ex2() (así como otras funciones de inicialización de cifrado y descifrado de nombre similar). En lugar de usar el cifrado personalizado directamente, intenta incorrectamente obtener un cifrado equivalente de los proveedores disponibles. Un cifrado equivalente es encontrado basado en el NID pasado a EVP_CIPHER_meth_new(). Este NID es supuesto que representa el único NID para un cifrado dado. Sin embargo, es posible que una aplicación pase incorrectamente NID_undef como este valor en la llamada a EVP_CIPHER_meth_new(). Cuando NID_undef es usado de esta manera, la función de inicialización de encriptación/desencriptación de OpenSSL hará coincidir el cifrado NULL como equivalente y lo obtendrá de los proveedores disponibles. Esto tendrá éxito si ha sido cargado el proveedor por defecto (o si ha sido cargado un proveedor de terceros que ofrece este cifrado). usar el cifrado NULL significa que el texto plano es emitido como el texto cifrado. Las aplicaciones sólo están afectadas por este problema si llaman a EVP_CIPHER_meth_new() usando NID_undef y posteriormente lo usan en una llamada a una función de inicialización de cifrado/descifrado. Las aplicaciones que sólo usan SSL/TLS no están afectadas por este problema. Corregido en OpenSSL versión 3.0.6 (Afectado versiones 3.0.0-3.0.5)

A flaw was found in OpenSSL, where it incorrectly handles 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 initialization 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 this way, the OpenSSL encryption/decryption initialization function will match the NULL cipher as equivalent and fetch this from the available providers. This is successful 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.

*Credits: Chris Rapier (Pittsburgh Supercomputing Center)
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2022-09-29 CVE Reserved
  • 2022-10-11 CVE Published
  • 2024-05-03 EPSS Updated
  • 2024-09-16 CVE Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
  • ---------- First Exploit
CWE
  • CWE-476: NULL Pointer Dereference
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Openssl
Search vendor "Openssl"
Openssl
Search vendor "Openssl" for product "Openssl"
>= 3.0.0 < 3.0.6
Search vendor "Openssl" for product "Openssl" and version " >= 3.0.0 < 3.0.6"
-
Affected