CVE-2022-0778Infinite loop in BN_mod_sqrt() reachable when parsing certificates
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).
What to do
Likely to be exploited: EPSS gives a 73% chance of exploitation in the next 30 days. Treat it as urgent if you run an affected version.
Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux, Ubuntu, crates.io: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | edk2 | Not affected vulnerable_code_not_present | ||
| Ubuntu 26.04 | nodejs | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | edk2 | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | nodejs | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | edk2 | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | nodejs | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | edk2 | Fixed | 2022.02-3ubuntu0.22.04.4 | UBUNTU-CVE-2022-0778 |
| Ubuntu 22.04 | nodejs | Fixed | 12.22.9~dfsg-1ubuntu3.1 | UBUNTU-CVE-2022-0778 |
| Ubuntu 22.04 | openssl | Fixed | 3.0.2-0ubuntu1 | UBUNTU-CVE-2022-0778 |
| Ubuntu 20.04 | edk2 | Fix pending | UBUNTU-CVE-2022-0778 | |
| Ubuntu 20.04 | openssl | Fixed | 1.1.1f-1ubuntu2.12 | UBUNTU-CVE-2022-0778 |
| Ubuntu 18.04 | edk2 | Fix pending | UBUNTU-CVE-2022-0778 | |
| Ubuntu 18.04 | openssl | Fixed | 1.1.1-1ubuntu2.1~18.04.15 | UBUNTU-CVE-2022-0778 |
| Ubuntu 18.04 | openssl1.0 | Fixed | 1.0.2n-1ubuntu5.8 | UBUNTU-CVE-2022-0778 |
| Ubuntu 16.04 | edk2 | Fix pending | ||
| Ubuntu 16.04 | nodejs | Not affected vulnerable_code_not_present | ||
| Ubuntu 16.04 | openssl | Fix pending | 1.0.2g-1ubuntu4.20+esm2 (Ubuntu Pro) | UBUNTU-CVE-2022-0778 |
| Ubuntu 14.04 | edk2 | Fix pending | ||
| Ubuntu 14.04 | openssl | Fix pending | 1.0.1f-1ubuntu2.27+esm5 (Ubuntu Pro) | UBUNTU-CVE-2022-0778 |
| Debian 14 | openssl | Fixed | 1.1.1n-1 | DEBIAN-CVE-2022-0778 |
| Debian 13 | openssl | Fixed | 1.1.1n-1 | DEBIAN-CVE-2022-0778 |
| Debian 12 | openssl | Fixed | 1.1.1n-1 | DEBIAN-CVE-2022-0778 |
| Red Hat Enterprise Linux 9 | compat-openssl11 | Fixed | 1:1.1.1k-4.el9_0 | RHSA-2022:4899 |
| Red Hat Enterprise Linux 9 | edk2 | Not affected | ||
| Red Hat Enterprise Linux 9 | edk2-aarch64 | Not affected | ||
| Red Hat Enterprise Linux 9 | edk2-ovmf | Not affected | ||
| Red Hat Enterprise Linux 9 | edk2-tools | Not affected | ||
| Red Hat Enterprise Linux 9 | edk2-tools-doc | Not affected | ||
| Red Hat Enterprise Linux 9 | openssl | Not affected | ||
| Red Hat Enterprise Linux 9 | openssl-devel | Not affected | ||
| Red Hat Enterprise Linux 9 | openssl-libs | Not affected | ||
| Red Hat Enterprise Linux 9 | openssl-perl | Not affected | ||
| Red Hat Enterprise Linux 9 | shim | Not affected | ||
| Red Hat Enterprise Linux 9 | shim-aa64 | Not affected | ||
| Red Hat Enterprise Linux 9 | shim-x64 | Not affected | ||
| Red Hat Enterprise Linux 8 | compat-openssl10 | Fixed | 1:1.0.2o-4.el8_6 | RHSA-2022:5326 |
| Red Hat Enterprise Linux 8 | edk2 | Not affected | ||
| Red Hat Enterprise Linux 8 | edk2-aarch64 | Not affected | ||
| Red Hat Enterprise Linux 8 | edk2-ovmf | Not affected | ||
| Red Hat Enterprise Linux 8 | openssl | Fixed | 1:1.1.1k-6.el8_5 | RHSA-2022:1065 |
| Red Hat Enterprise Linux 8 | openssl-devel | Fixed | 1:1.1.1k-6.el8_5 | RHSA-2022:1065 |
| Red Hat Enterprise Linux 8 | openssl-libs | Fixed | 1:1.1.1k-6.el8_5 | RHSA-2022:1065 |
| Red Hat Enterprise Linux 8 | openssl-perl | Fixed | 1:1.1.1k-6.el8_5 | RHSA-2022:1065 |
| Red Hat Enterprise Linux 8 | shim | Not affected | ||
| Red Hat Enterprise Linux 8 | shim-aa64 | Not affected | ||
| Red Hat Enterprise Linux 8 | shim-ia32 | Not affected | ||
| Red Hat Enterprise Linux 8 | shim-x64 | Not affected | ||
| Red Hat Enterprise Linux 7 | AAVMF | Not affected | ||
| Red Hat Enterprise Linux 7 | OVMF | Not affected | ||
| Red Hat Enterprise Linux 7 | openssl | Fixed | 1:1.0.2k-25.el7_9 | RHSA-2022:1066 |
| Red Hat Enterprise Linux 7 | openssl-devel | Fixed | 1:1.0.2k-25.el7_9 | RHSA-2022:1066 |
| Red Hat Enterprise Linux 7 | openssl-libs | Fixed | 1:1.0.2k-25.el7_9 | RHSA-2022:1066 |
| Red Hat Enterprise Linux 7 | openssl-perl | Fixed | 1:1.0.2k-25.el7_9 | RHSA-2022:1066 |
| Red Hat Enterprise Linux 7 | openssl-static | Fixed | 1:1.0.2k-25.el7_9 | RHSA-2022:1066 |
| Red Hat Enterprise Linux 7 | openssl098e | Not affected | ||
| Red Hat Enterprise Linux 7 | ovmf | Not affected | ||
| Red Hat Enterprise Linux 7 | redhat-virtualization-host | Fixed | 0:4.3.22-20220330.1.el7_9 | RHSA-2022:1263 |
| Red Hat Enterprise Linux 7 | redhat-virtualization-host-image-update | Fixed | 0:4.3.22-20220330.1.el7_9 | RHSA-2022:1263 |
| Red Hat Enterprise Linux 6 | openssl098e | Not affected | ||
| AlmaLinux 8 | compat-openssl10 | Fixed | 1:1.0.2o-4.el8_6 | ALSA-2022:5326 |
| AlmaLinux 8 | openssl | Fixed | 1:1.1.1k-6.el8_5 | ALSA-2022:1065 |
| AlmaLinux 8 | openssl-devel | Fixed | 1:1.1.1k-6.el8_5 | ALSA-2022:1065 |
| AlmaLinux 8 | openssl-libs | Fixed | 1:1.1.1k-6.el8_5 | ALSA-2022:1065 |
| AlmaLinux 8 | openssl-perl | Fixed | 1:1.1.1k-6.el8_5 | ALSA-2022:1065 |
| Rocky Linux 9 | compat-openssl11 | Fixed | 1:1.1.1k-4.el9_0 | RLSA-2022:4899 |
| Rocky Linux 8 | compat-openssl10 | Fixed | 1:1.0.2o-4.el8_6 | RLSA-2022:5326 |
| Rocky Linux 8 | openssl | Fixed | 1:1.1.1k-6.el8_5 | RLSA-2022:1065 |
| Alpine Linux 3.24 | libressl | Fixed | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.24 | libretls | Fixed | 3.5.1-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.24 | lighthouse | Fixed | 2.2.0-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.24 | openjdk11 | Fixed | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.24 | openssl | Fixed | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.23 | libressl | Fixed | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.23 | libretls | Fixed | 3.5.1-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.23 | lighthouse | Fixed | 2.2.0-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.23 | openjdk11 | Fixed | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.23 | openssl | Fixed | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.22 | libressl | Fixed | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.22 | libretls | Fixed | 3.5.1-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.22 | lighthouse | Fixed | 2.2.0-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.22 | openjdk11 | Fixed | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.22 | openssl | Fixed | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.21 | libressl | Fixed | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.21 | libretls | Fixed | 3.5.1-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.21 | lighthouse | Fixed | 2.2.0-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.21 | openjdk11 | Fixed | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.21 | openssl | Fixed | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.20 | libressl | Fixed | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.20 | libretls | Fixed | 3.5.1-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.20 | lighthouse | Fixed | 2.2.0-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.20 | openjdk11 | Fixed | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.20 | openssl | Fixed | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.19 | libressl | Fixed | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.19 | libretls | Fixed | 3.5.1-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.19 | lighthouse | Fixed | 2.2.0-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.19 | openjdk11 | Fixed | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.19 | openssl | Fixed | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.18 | libressl | Fixed | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.18 | libretls | Fixed | 3.5.1-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.18 | openjdk11 | Fixed | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.18 | openssl | Fixed | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.18 | openssl1.1-compat | Fixed | 1.1.1n-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.17 | libressl | Fixed | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.17 | libretls | Fixed | 3.5.1-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.17 | openjdk11 | Fixed | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.17 | openssl | Fixed | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.17 | openssl1.1-compat | Fixed | 1.1.1n-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.16 | libressl | Fixed | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.16 | libretls | Fixed | 3.5.1-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.16 | openjdk11 | Fixed | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.16 | openssl | Fixed | 1.1.1n-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.16 | openssl3 | Fixed | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.15 | libressl | Fixed | 3.4.3-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.15 | libretls | Fixed | 3.3.4-r3 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.15 | openjdk11 | Fixed | 11.0.15_p10-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.15 | openssl | Fixed | 1.1.1n-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.15 | openssl3 | Fixed | 3.0.2-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.14 | libressl | Fixed | 3.3.6-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.14 | libretls | Fixed | 3.3.3p1-r3 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.14 | openssl | Fixed | 1.1.1n-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.13 | openssl | Fixed | 1.1.1n-r0 | ALPINE-CVE-2022-0778 |
| Alpine Linux 3.12 | openssl | Fixed | 1.1.1n-r0 | ALPINE-CVE-2022-0778 |
| crates.io library | openssl-src | Fixed | 111.18.0 | GHSA-x3mh-jvjw-3xwx |
What the vendor says
As published in the CVE record by openssl, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- OpenSSL: affected: 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)
Vendor advisories:
- https://www.debian.org/security/2022/dsa-5103 (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://security.gentoo.org/glsa/202210-02 (vendor-advisory)
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
- https://www.debian.org/security/2022/dsa-5103
- https://lists.debian.org/debian-lts-announce/2022/03/msg00023.html
- https://lists.debian.org/debian-lts-announce/2022/03/msg00024.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GDB3GQVJPXJE7X5C5JN6JAA4XUDWD6E6/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/323SNN6ZX7PRJJWP2BUAFLPUAE42XWLZ/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/W6K3PR542DXWLEFFMFIDMME4CWMHJRMG/
- 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
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.