High severity · published Mar 15, 2022
CVE-2022-0778
Infinite loop in BN_mod_sqrt() reachable when parsing certificates
7.5
CVSS
73.2%
EPSS
No
On KEV
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).
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Confidentiality
None
Integrity
None
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)73.2% · higher than 99% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
OP
OpenSSL · OpenSSL
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) · source: vendor, NVD
5F
500f Firmware · Netapp
All versions, or not specified · source: NVD
AF
A250 Firmware · Netapp
All versions, or not specified · source: NVD
CV
Cloud Volumes Ontap Mediator · Netapp
All versions, or not specified · source: NVD
CD
Clustered Data Ontap · Netapp
All versions, or not specified · source: NVD
CD
Clustered Data Ontap Antivirus Connector · Netapp
All versions, or not specified · source: NVD
DL
Debian Linux · Debian
9.0; 10.0; 11.0 · source: NVD
FE
Fedora · Fedoraproject
34; 36 · source: NVD
MA
Mariadb · Mariadb
10.2.0 before 10.2.42; 10.3.0 before 10.3.33; 10.4.0 before 10.4.23; 10.5.0 before 10.5.14; 10.6.0 before 10.6.6; 10.7.0 before 10.7.2 · source: NVD
NE
Nessus · Tenable
before 8.15.4; 10.0.0 before 10.1.2 · source: NVD
NO
Node.js · Nodejs
12.0.0 through 12.12.0; 12.13.0 before 12.22.11; after 14.0.0 through 14.14.0; 14.15.0 before 14.19.1; after 16.0.0 through 16.12.0; 16.13.0 before 16.14.2; +1 more · source: NVD
SS
Santricity Smi-s Provider · Netapp
All versions, or not specified · source: NVD
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2022-0778
CVE.org
https://www.cve.org/CVERecord?id=CVE-2022-0778
Third Party Advisory
http://packetstormsecurity.com/files/167344/OpenSSL-1.0.2-1.1.1-3.0-BN_mod_sqrt-Infinite-Loop.html
Mailing List
http://seclists.org/fulldisclosure/2022/May/33
Mailing List
http://seclists.org/fulldisclosure/2022/May/35
Mailing List
http://seclists.org/fulldisclosure/2022/May/38
Third Party Advisory
https://cert-portal.siemens.com/productcert/pdf/ssa-712929.pdf
git.openssl.org
https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=3118eb64934499d93db3230748a452351d1d9a65
More from OpenSSL
7.5
CVE-2014-0160
OpenSSL Information Disclosure Vulnerability
9.8
CVE-2026-63073
Untrusted Sender DN Used as Format String in CMP Response Validation
9.8
CVE-2026-31789
Heap Buffer Overflow in Hexadecimal Conversion
9.8
CVE-2022-2274
RSA implementation bug in AVX512IFMA instructions
9.8
CVE-2021-3711
SM2 Decryption Buffer Overflow
