Vulnerability · Published Mar 15, 2022 · Assigned by openssl
CVE-2022-0778Infinite loop in BN_mod_sqrt() reachable when parsing certificates
High 7.5
In plain English
A high-severity infinite loop in OpenSSL from OpenSSL. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 73.2% (higher than 99.5% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.
Official 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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | compat-openssl10 | 1:1.0.2o-4.el8_6 | ALSA-2022:5326 |
| AlmaLinux:8 | openssl | 1:1.1.1k-6.el8_5 | ALSA-2022:1065 |
| AlmaLinux:8 | openssl-devel | 1:1.1.1k-6.el8_5 | ALSA-2022:1065 |
| AlmaLinux:8 | openssl-libs | 1:1.1.1k-6.el8_5 | ALSA-2022:1065 |
| AlmaLinux:8 | openssl-perl | 1:1.1.1k-6.el8_5 | ALSA-2022:1065 |
| Alpine:v3.20 | libressl | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.21 | libressl | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.22 | libressl | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.23 | libressl | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.24 | libressl | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.20 | libretls | 3.5.1-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.21 | libretls | 3.5.1-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.22 | libretls | 3.5.1-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.23 | libretls | 3.5.1-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.24 | libretls | 3.5.1-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.20 | lighthouse | 2.2.0-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.21 | lighthouse | 2.2.0-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.22 | lighthouse | 2.2.0-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.23 | lighthouse | 2.2.0-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.24 | lighthouse | 2.2.0-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.20 | openjdk11 | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.21 | openjdk11 | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.22 | openjdk11 | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.23 | openjdk11 | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.24 | openjdk11 | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.20 | openssl | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.21 | openssl | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.22 | openssl | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.23 | openssl | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Alpine:v3.24 | openssl | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Debian:12 | openssl | 1.1.1n-1 | DEBIAN-CVE-2022-0778 |
| Debian:13 | openssl | 1.1.1n-1 | DEBIAN-CVE-2022-0778 |
| Debian:14 | openssl | 1.1.1n-1 | DEBIAN-CVE-2022-0778 |
| Rocky Linux:8 | compat-openssl10 | 1:1.0.2o-4.el8_6 | RLSA-2022:5326 |
| Rocky Linux:9 | compat-openssl11 | 1:1.1.1k-4.el9_0 | RLSA-2022:4899 |
| Rocky Linux:8 | openssl | 1:1.1.1k-6.el8_5 | RLSA-2022:1065 |
| Ubuntu:22.04:LTS | edk2 | 2022.02-3ubuntu0.22.04.4 | UBUNTU-CVE-2022-0778 |
| Ubuntu:22.04:LTS | edk2 | 2022.02-3ubuntu0.22.04.4 | USN-7894-1 |
| Ubuntu:24.04:LTS | edk2 | 2024.02-2ubuntu0.6 | USN-7894-1 |
| Ubuntu:22.04:LTS | nodejs | 12.22.9~dfsg-1ubuntu3.1 | USN-6457-1 |
| Ubuntu:22.04:LTS | nodejs | 12.22.9~dfsg-1ubuntu3.1 | UBUNTU-CVE-2022-0778 |
| Ubuntu:22.04:LTS | openssl | 3.0.2-0ubuntu1 | UBUNTU-CVE-2022-0778 |
Affected products (as reported)
Weakness: CWE-835 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- https://www.openssl.org/news/secadv/20220315.txt
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=a466912611aa6cbdf550cd10601390e587451246
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=3118eb64934499d93db3230748a452351d1d9a65
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=380085481c64de749a6dd25cdf0bcf4360b30f83
- DSA-5103 vendor-advisory
- [debian-lts-announce] 20220317 [SECURITY] [DLA 2952-1] openssl security update mailing-list
- [debian-lts-announce] 20220317 [SECURITY] [DLA 2953-1] openssl1.0 security update mailing-list
- FEDORA-2022-a5f51502f0 vendor-advisory
- FEDORA-2022-9e88b5d8d7 vendor-advisory
- FEDORA-2022-8bb51f6901 vendor-advisory
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://security.netapp.com/advisory/ntap-20220321-0002/
- https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2022-0002
- https://www.tenable.com/security/tns-2022-06
- https://www.tenable.com/security/tns-2022-07
- https://www.tenable.com/security/tns-2022-08
- 20220516 APPLE-SA-2022-05-16-4 Security Update 2022-004 Catalina mailing-list
- 20220516 APPLE-SA-2022-05-16-3 macOS Big Sur 11.6.6 mailing-list
- 20220516 APPLE-SA-2022-05-16-2 macOS Monterey 12.4 mailing-list
- https://www.oracle.com/security-alerts/cpujul2022.html
- https://support.apple.com/kb/HT213257
- https://support.apple.com/kb/HT213256
- https://support.apple.com/kb/HT213255
- https://www.tenable.com/security/tns-2022-09
- https://security.netapp.com/advisory/ntap-20220429-0005/
- http://packetstormsecurity.com/files/167344/OpenSSL-1.0.2-1.1.1-3.0-BN_mod_sqrt-Infinite-Loop.html
- https://cert-portal.siemens.com/productcert/pdf/ssa-712929.pdf
- GLSA-202210-02 vendor-advisory
- https://security.netapp.com/advisory/ntap-20240621-0006/
- https://cert-portal.siemens.com/productcert/html/ssa-712929.html
- https://cert-portal.siemens.com/productcert/html/ssa-398330.html
- https://cert-portal.siemens.com/productcert/html/ssa-108696.html
- https://cert-portal.siemens.com/productcert/html/ssa-028723.html
- https://cert-portal.siemens.com/productcert/html/ssa-019200.html