CVEfocus › CVE database › CVE-2022-0778

CVE-2022-0778Infinite loop in BN_mod_sqrt() reachable when parsing certificates

CVSS 7.5 HighEPSS 73.2% (in the top 1% of all CVEs)Published 2022-03-15Updated 2026-10-14Assigner: openssl

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

CWE-835

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

86Fixed
6Fix pending
31Not affected

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04edk2Not affected
vulnerable_code_not_present
Ubuntu 26.04nodejsNot affected
vulnerable_code_not_present
Ubuntu 25.10edk2Not affected
vulnerable_code_not_present
Ubuntu 25.10nodejsNot affected
vulnerable_code_not_present
Ubuntu 24.04edk2Not affected
vulnerable_code_not_present
Ubuntu 24.04nodejsNot affected
vulnerable_code_not_present
Ubuntu 22.04edk2Fixed2022.02-3ubuntu0.22.04.4UBUNTU-CVE-2022-0778
Ubuntu 22.04nodejsFixed12.22.9~dfsg-1ubuntu3.1UBUNTU-CVE-2022-0778
Ubuntu 22.04opensslFixed3.0.2-0ubuntu1UBUNTU-CVE-2022-0778
Ubuntu 20.04edk2Fix pendingUBUNTU-CVE-2022-0778
Ubuntu 20.04opensslFixed1.1.1f-1ubuntu2.12UBUNTU-CVE-2022-0778
Ubuntu 18.04edk2Fix pendingUBUNTU-CVE-2022-0778
Ubuntu 18.04opensslFixed1.1.1-1ubuntu2.1~18.04.15UBUNTU-CVE-2022-0778
Ubuntu 18.04openssl1.0Fixed1.0.2n-1ubuntu5.8UBUNTU-CVE-2022-0778
Ubuntu 16.04edk2Fix pending
Ubuntu 16.04nodejsNot affected
vulnerable_code_not_present
Ubuntu 16.04opensslFix pending1.0.2g-1ubuntu4.20+esm2 (Ubuntu Pro)UBUNTU-CVE-2022-0778
Ubuntu 14.04edk2Fix pending
Ubuntu 14.04opensslFix pending1.0.1f-1ubuntu2.27+esm5 (Ubuntu Pro)UBUNTU-CVE-2022-0778
Debian 14opensslFixed1.1.1n-1DEBIAN-CVE-2022-0778
Debian 13opensslFixed1.1.1n-1DEBIAN-CVE-2022-0778
Debian 12opensslFixed1.1.1n-1DEBIAN-CVE-2022-0778
Red Hat Enterprise Linux 9compat-openssl11Fixed1:1.1.1k-4.el9_0RHSA-2022:4899
Red Hat Enterprise Linux 9edk2Not affected
Red Hat Enterprise Linux 9edk2-aarch64Not affected
Red Hat Enterprise Linux 9edk2-ovmfNot affected
Red Hat Enterprise Linux 9edk2-toolsNot affected
Red Hat Enterprise Linux 9edk2-tools-docNot affected
Red Hat Enterprise Linux 9opensslNot affected
Red Hat Enterprise Linux 9openssl-develNot affected
Red Hat Enterprise Linux 9openssl-libsNot affected
Red Hat Enterprise Linux 9openssl-perlNot affected
Red Hat Enterprise Linux 9shimNot affected
Red Hat Enterprise Linux 9shim-aa64Not affected
Red Hat Enterprise Linux 9shim-x64Not affected
Red Hat Enterprise Linux 8compat-openssl10Fixed1:1.0.2o-4.el8_6RHSA-2022:5326
Red Hat Enterprise Linux 8edk2Not affected
Red Hat Enterprise Linux 8edk2-aarch64Not affected
Red Hat Enterprise Linux 8edk2-ovmfNot affected
Red Hat Enterprise Linux 8opensslFixed1:1.1.1k-6.el8_5RHSA-2022:1065
Red Hat Enterprise Linux 8openssl-develFixed1:1.1.1k-6.el8_5RHSA-2022:1065
Red Hat Enterprise Linux 8openssl-libsFixed1:1.1.1k-6.el8_5RHSA-2022:1065
Red Hat Enterprise Linux 8openssl-perlFixed1:1.1.1k-6.el8_5RHSA-2022:1065
Red Hat Enterprise Linux 8shimNot affected
Red Hat Enterprise Linux 8shim-aa64Not affected
Red Hat Enterprise Linux 8shim-ia32Not affected
Red Hat Enterprise Linux 8shim-x64Not affected
Red Hat Enterprise Linux 7AAVMFNot affected
Red Hat Enterprise Linux 7OVMFNot affected
Red Hat Enterprise Linux 7opensslFixed1:1.0.2k-25.el7_9RHSA-2022:1066
Red Hat Enterprise Linux 7openssl-develFixed1:1.0.2k-25.el7_9RHSA-2022:1066
Red Hat Enterprise Linux 7openssl-libsFixed1:1.0.2k-25.el7_9RHSA-2022:1066
Red Hat Enterprise Linux 7openssl-perlFixed1:1.0.2k-25.el7_9RHSA-2022:1066
Red Hat Enterprise Linux 7openssl-staticFixed1:1.0.2k-25.el7_9RHSA-2022:1066
Red Hat Enterprise Linux 7openssl098eNot affected
Red Hat Enterprise Linux 7ovmfNot affected
Red Hat Enterprise Linux 7redhat-virtualization-hostFixed0:4.3.22-20220330.1.el7_9RHSA-2022:1263
Red Hat Enterprise Linux 7redhat-virtualization-host-image-updateFixed0:4.3.22-20220330.1.el7_9RHSA-2022:1263
Red Hat Enterprise Linux 6openssl098eNot affected
AlmaLinux 8compat-openssl10Fixed1:1.0.2o-4.el8_6ALSA-2022:5326
AlmaLinux 8opensslFixed1:1.1.1k-6.el8_5ALSA-2022:1065
AlmaLinux 8openssl-develFixed1:1.1.1k-6.el8_5ALSA-2022:1065
AlmaLinux 8openssl-libsFixed1:1.1.1k-6.el8_5ALSA-2022:1065
AlmaLinux 8openssl-perlFixed1:1.1.1k-6.el8_5ALSA-2022:1065
Rocky Linux 9compat-openssl11Fixed1:1.1.1k-4.el9_0RLSA-2022:4899
Rocky Linux 8compat-openssl10Fixed1:1.0.2o-4.el8_6RLSA-2022:5326
Rocky Linux 8opensslFixed1:1.1.1k-6.el8_5RLSA-2022:1065
Alpine Linux 3.24libresslFixed3.4.3-r0ALPINE-CVE-2022-0778
Alpine Linux 3.24libretlsFixed3.5.1-r0ALPINE-CVE-2022-0778
Alpine Linux 3.24lighthouseFixed2.2.0-r0ALPINE-CVE-2022-0778
Alpine Linux 3.24openjdk11Fixed11.0.15_p10-r0ALPINE-CVE-2022-0778
Alpine Linux 3.24opensslFixed3.0.2-r0ALPINE-CVE-2022-0778
Alpine Linux 3.23libresslFixed3.4.3-r0ALPINE-CVE-2022-0778
Alpine Linux 3.23libretlsFixed3.5.1-r0ALPINE-CVE-2022-0778
Alpine Linux 3.23lighthouseFixed2.2.0-r0ALPINE-CVE-2022-0778
Alpine Linux 3.23openjdk11Fixed11.0.15_p10-r0ALPINE-CVE-2022-0778
Alpine Linux 3.23opensslFixed3.0.2-r0ALPINE-CVE-2022-0778
Alpine Linux 3.22libresslFixed3.4.3-r0ALPINE-CVE-2022-0778
Alpine Linux 3.22libretlsFixed3.5.1-r0ALPINE-CVE-2022-0778
Alpine Linux 3.22lighthouseFixed2.2.0-r0ALPINE-CVE-2022-0778
Alpine Linux 3.22openjdk11Fixed11.0.15_p10-r0ALPINE-CVE-2022-0778
Alpine Linux 3.22opensslFixed3.0.2-r0ALPINE-CVE-2022-0778
Alpine Linux 3.21libresslFixed3.4.3-r0ALPINE-CVE-2022-0778
Alpine Linux 3.21libretlsFixed3.5.1-r0ALPINE-CVE-2022-0778
Alpine Linux 3.21lighthouseFixed2.2.0-r0ALPINE-CVE-2022-0778
Alpine Linux 3.21openjdk11Fixed11.0.15_p10-r0ALPINE-CVE-2022-0778
Alpine Linux 3.21opensslFixed3.0.2-r0ALPINE-CVE-2022-0778
Alpine Linux 3.20libresslFixed3.4.3-r0ALPINE-CVE-2022-0778
Alpine Linux 3.20libretlsFixed3.5.1-r0ALPINE-CVE-2022-0778
Alpine Linux 3.20lighthouseFixed2.2.0-r0ALPINE-CVE-2022-0778
Alpine Linux 3.20openjdk11Fixed11.0.15_p10-r0ALPINE-CVE-2022-0778
Alpine Linux 3.20opensslFixed3.0.2-r0ALPINE-CVE-2022-0778
Alpine Linux 3.19libresslFixed3.4.3-r0ALPINE-CVE-2022-0778
Alpine Linux 3.19libretlsFixed3.5.1-r0ALPINE-CVE-2022-0778
Alpine Linux 3.19lighthouseFixed2.2.0-r0ALPINE-CVE-2022-0778
Alpine Linux 3.19openjdk11Fixed11.0.15_p10-r0ALPINE-CVE-2022-0778
Alpine Linux 3.19opensslFixed3.0.2-r0ALPINE-CVE-2022-0778
Alpine Linux 3.18libresslFixed3.4.3-r0ALPINE-CVE-2022-0778
Alpine Linux 3.18libretlsFixed3.5.1-r0ALPINE-CVE-2022-0778
Alpine Linux 3.18openjdk11Fixed11.0.15_p10-r0ALPINE-CVE-2022-0778
Alpine Linux 3.18opensslFixed3.0.2-r0ALPINE-CVE-2022-0778
Alpine Linux 3.18openssl1.1-compatFixed1.1.1n-r0ALPINE-CVE-2022-0778
Alpine Linux 3.17libresslFixed3.4.3-r0ALPINE-CVE-2022-0778
Alpine Linux 3.17libretlsFixed3.5.1-r0ALPINE-CVE-2022-0778
Alpine Linux 3.17openjdk11Fixed11.0.15_p10-r0ALPINE-CVE-2022-0778
Alpine Linux 3.17opensslFixed3.0.2-r0ALPINE-CVE-2022-0778
Alpine Linux 3.17openssl1.1-compatFixed1.1.1n-r0ALPINE-CVE-2022-0778
Alpine Linux 3.16libresslFixed3.4.3-r0ALPINE-CVE-2022-0778
Alpine Linux 3.16libretlsFixed3.5.1-r0ALPINE-CVE-2022-0778
Alpine Linux 3.16openjdk11Fixed11.0.15_p10-r0ALPINE-CVE-2022-0778
Alpine Linux 3.16opensslFixed1.1.1n-r0ALPINE-CVE-2022-0778
Alpine Linux 3.16openssl3Fixed3.0.2-r0ALPINE-CVE-2022-0778
Alpine Linux 3.15libresslFixed3.4.3-r0ALPINE-CVE-2022-0778
Alpine Linux 3.15libretlsFixed3.3.4-r3ALPINE-CVE-2022-0778
Alpine Linux 3.15openjdk11Fixed11.0.15_p10-r0ALPINE-CVE-2022-0778
Alpine Linux 3.15opensslFixed1.1.1n-r0ALPINE-CVE-2022-0778
Alpine Linux 3.15openssl3Fixed3.0.2-r0ALPINE-CVE-2022-0778
Alpine Linux 3.14libresslFixed3.3.6-r0ALPINE-CVE-2022-0778
Alpine Linux 3.14libretlsFixed3.3.3p1-r3ALPINE-CVE-2022-0778
Alpine Linux 3.14opensslFixed1.1.1n-r0ALPINE-CVE-2022-0778
Alpine Linux 3.13opensslFixed1.1.1n-r0ALPINE-CVE-2022-0778
Alpine Linux 3.12opensslFixed1.1.1n-r0ALPINE-CVE-2022-0778
crates.io libraryopenssl-srcFixed111.18.0GHSA-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.

Vendor advisories:

References

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.