CVE-2022-0778
JSON

7.5high

Infinite loop in BN_mod_sqrt() reachable when parsing certificates

Severity
7.5high CVSS:3.1 by CISA-ADP
Exploit likelihood
73.2% (higher than 99% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
openssl
Also known as
GHSA-x3mh-jvjw-3xwxBIT-MARIADB-2022-0778BIT-MARIADB-MIN-2022-0778BIT-MYSQL-CLIENT-2022-0778BIT-NODE-2022-0778BIT-NODE-MIN-2022-0778RUSTSEC-2022-0014

Description

The BN_mod_sqrt() function, which computes a modular square root, contains a bug that can cause it to loop forever for non-prime moduli. Internally this function is used when parsing certificates that contain elliptic curve public keys in compressed form or explicit elliptic curve parameters with a base point encoded in compressed form. It is possible to trigger the infinite loop by crafting a certificate that has invalid explicit curve parameters. Since certificate parsing happens prior to verification of the certificate signature, any process that parses an externally supplied certificate may thus be subject to a denial of service attack. The infinite loop can also be reached when parsing crafted private keys as they can contain explicit elliptic curve parameters. Thus vulnerable situations include: - TLS clients consuming server certificates - TLS servers consuming client certificates - Hosting providers taking certificates or private keys from customers - Certificate authorities parsing certification requests from subscribers - Anything else which parses ASN.1 elliptic curve parameters Also any other applications that use the BN_mod_sqrt() where the attacker can control the parameter values are vulnerable to this DoS issue. In the OpenSSL 1.0.2 version the public key is not parsed during initial parsing of the certificate which makes it slightly harder to trigger the infinite loop. However any operation which requires the public key from the certificate will trigger the infinite loop. In particular the attacker can use a self-signed certificate to trigger the loop during verification of the certificate signature. This issue affects OpenSSL versions 1.0.2, 1.1.1 and 3.0. It was addressed in the releases of 1.1.1n and 3.0.2 on the 15th March 2022. Fixed in OpenSSL 3.0.2 (Affected 3.0.0,3.0.1). Fixed in OpenSSL 1.1.1n (Affected 1.1.1-1.1.1m). Fixed in OpenSSL 1.0.2zd (Affected 1.0.2-1.0.2zc).

Affected

Product or packageVersionsReported by
OpenSSL OpenSSLFixed in OpenSSL 3.0.2 (Affected 3.0.0,3.0.1), Fixed in OpenSSL 1.1.1n (Affected 1.1.1-1.1.1m), Fixed in OpenSSL 1.0.2zd (Affected 1.0.2-1.0.2zc), from 1.0.2 before 1.0.2zd, from 1.1.0 before 1.1.1n, from 3.0.0 before 3.0.2CVE List, NVD
openssl-src (crates.io)from 300.0.0 before 300.0.5, before 111.18.0, from 0.0.0-0 before 111.18.0GitHub Advisory Database, RustSec Advisory Database
debian debian_linux9.0, 10.0, 11.0NVD
netapp cloud_volumes_ontap_mediatorNot specifiedNVD
netapp clustered_data_ontapNot specifiedNVD
netapp clustered_data_ontap_antivirus_connectorNot specifiedNVD
netapp santricity_smi-s_providerNot specifiedNVD
netapp storagegridNot specifiedNVD
netapp a250_firmwareNot specifiedNVD
netapp 500f_firmwareNot specifiedNVD
fedoraproject fedora34, 36NVD
tenable nessusbefore 8.15.4, from 10.0.0 before 10.1.2NVD

All scores

CISA-ADP7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:N/I:N/A:P
Bitnami Vulnerability Databasehigh rating

Classification

CWE-835

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

The BN_mod_sqrt() function, which computes a modular square root, contains a bug that can cause it to loop forever for non-prime moduli. Internally this function is used when parsing certificates that contain elliptic curve public keys in compressed form or explicit elliptic curve parameters with a base point encoded in compressed form. It is possible to trigger the infinite loop by crafting a certificate that has invalid explicit curve parameters. Since certificate parsing happens prior to verification of the certificate signature, any process that parses an externally supplied certificate may thus be subject to a denial of service attack. The infinite loop can also be reached when parsing crafted private keys as they can contain explicit elliptic curve parameters. Thus vulnerable situations include: - TLS clients consuming server certificates - TLS servers consuming client certificates - Hosting providers taking certificates or private keys from customers - Certificate authorities parsing certification requests from subscribers - Anything else which parses ASN.1 elliptic curve parameters Also any other applications that use the BN_mod_sqrt() where the attacker can control the parameter values are vulnerable to this DoS issue. In the OpenSSL 1.0.2 version the public key is not parsed during initial parsing of the certificate which makes it slightly harder to trigger the infinite loop. However any operation which requires the public key from the certificate will trigger the infinite loop. In particular the attacker can use a self-signed certificate to trigger the loop during verification of the certificate signature. This issue affects OpenSSL versions 1.0.2, 1.1.1 and 3.0. It was addressed in the releases of 1.1.1n and 3.0.2 on the 15th March 2022. Fixed in OpenSSL 3.0.2 (Affected 3.0.0,3.0.1). Fixed in OpenSSL 1.1.1n (Affected 1.1.1-1.1.1m). Fixed in OpenSSL 1.0.2zd (Affected 1.0.2-1.0.2zc).

RustSec Advisory Database

The BN_mod_sqrt() function, which computes a modular square root, contains a bug that can cause it to loop forever for non-prime moduli.

Internally this function is used when parsing certificates that contain elliptic curve public keys in compressed form or explicit elliptic curve parameters with a base point encoded in compressed form.

It is possible to trigger the infinite loop by crafting a certificate that has invalid explicit curve parameters.

Since certificate parsing happens prior to verification of the certificate signature, any process that parses an externally supplied certificate may thus be subject to a denial of service attack. The infinite loop can also be reached when parsing crafted private keys as they can contain explicit elliptic curve parameters.

Thus vulnerable situations include:

  • TLS clients consuming server certificates
  • TLS servers consuming client certificates
  • Hosting providers taking certificates or private keys from customers
  • Certificate authorities parsing certification requests from subscribers
  • Anything else which parses ASN.1 elliptic curve parameters

Also any other applications that use the BN_mod_sqrt() where the attacker can control the parameter values are vulnerable to this DoS issue.

NVD (es)

La función BN_mod_sqrt(), que calcula una raíz cuadrada modular, contiene un error que puede causar un bucle eterno para módulos no primos. Internamente, esta función es usado cuando son analizados certificados que contienen claves públicas de curva elíptica en forma comprimida o parámetros de curva elíptica explícitos con un punto base codificado en forma comprimida. Es posible desencadenar el bucle infinito si es diseñado un certificado con parámetros de curva explícitos no válidos. Dado que el análisis del certificado es realizado antes de la verificación de la firma del certificado, cualquier proceso que analice un certificado suministrado externamente puede ser objeto de un ataque de denegación de servicio. El bucle infinito también puede alcanzarse cuando son analizadas claves privadas diseñadas, ya que pueden contener parámetros explícitos de la curva elíptica. Por lo tanto, las situaciones vulnerables incluyen: - Clientes TLS que consumen certificados de servidor - Servidores TLS que consumen certificados de cliente - Proveedores de hosting que toman certificados o claves privadas de clientes - Autoridades de certificación que analizan peticiones de certificación de suscriptores - Cualquier otra cosa que analice parámetros de curva elíptica ASN.1 También cualquier otra aplicación que utilice BN_mod_sqrt() donde el atacante pueda controlar los valores de los parámetros es vulnerable a este problema de DoS. En OpenSSL versión 1.0.2, la clave pública no es analizada durante el análisis inicial del certificado, lo que dificulta ligeramente la activación del bucle infinito. Sin embargo, cualquier operación que requiera la clave pública del certificado desencadenará el bucle infinito. En particular, el atacante puede usar un certificado autofirmado para desencadenar el bucle durante la verificación de la firma del certificado. Este problema afecta a OpenSSL versiones 1.0.2, 1.1.1 y 3.0. Fue abordado en las versiones 1.1.1n y 3.0.2 del 15 de marzo de 2022. Corregido en OpenSSL versión 3.0.2 (Afectado 3.0.0,3.0.1). Corregido en OpenSSL versión 1.1.1n (Afectado 1.1.1-1.1.1m). Corregido en OpenSSL versión 1.0.2zd (Afectado 1.0.2-1.0.2zc)

References

https://www.openssl.org/news/secadv/20220315.txtadvisory, vendor-advisory, web
https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=a466912611aa6cbdf550cd10601390e587451246web
https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=3118eb64934499d93db3230748a452351d1d9a65web
https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=380085481c64de749a6dd25cdf0bcf4360b30f83web
https://www.debian.org/security/2022/dsa-5103advisory, third-party-advisory, vendor-advisory, web
https://lists.debian.org/debian-lts-announce/2022/03/msg00023.htmladvisory, mailing-list, third-party-advisory, web
https://lists.debian.org/debian-lts-announce/2022/03/msg00024.htmladvisory, mailing-list, third-party-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GDB3GQVJPXJE7X5C5JN6JAA4XUDWD6E6/vendor-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/323SNN6ZX7PRJJWP2BUAFLPUAE42XWLZ/vendor-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/W6K3PR542DXWLEFFMFIDMME4CWMHJRMG/vendor-advisory, web
https://www.oracle.com/security-alerts/cpuapr2022.htmladvisory, third-party-advisory, web
https://security.netapp.com/advisory/ntap-20220321-0002/advisory, third-party-advisory

Sources

SourceRecordLicence
CVE ListCVE-2022-0778 changed 2026-10-14CVE Terms of Use
GitHub Advisory DatabaseGHSA-x3mh-jvjw-3xwx changed 2026-09-10CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2022-0014 changed 2025-06-10CC0-1.0
NVDCVE-2022-0778 changed 2026-10-14Public domain
Bitnami Vulnerability DatabaseBIT-MARIADB-2022-0778 changed 2026-10-16Apache-2.0
Bitnami Vulnerability DatabaseBIT-MARIADB-MIN-2022-0778 changed 2026-10-16Apache-2.0
Bitnami Vulnerability DatabaseBIT-MYSQL-CLIENT-2022-0778 changed 2026-10-16Apache-2.0
Bitnami Vulnerability DatabaseBIT-NODE-2022-0778 changed 2026-10-16Apache-2.0
Bitnami Vulnerability DatabaseBIT-NODE-MIN-2022-0778 changed 2026-10-16Apache-2.0