CVE-2022-0778
Infinite loop in BN_mod_sqrt() reachable when parsing certificates
Check your servers for CVE-2022-0778
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2022-0778 affects openssl, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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).
Severity (CVSS)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- none: the attacker does not need an account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality none, integrity none, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 73.1%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 99.4% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 22 May 2026):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- yes: an attacker can automate the attack across many targets
- Technical impact
- partial: limited control or limited data
Weakness
- CWE-835 Loop with Unreachable Exit Condition
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| OpenSSL |
affected Fixed in OpenSSL 3.0.2 (Affected 3.0.0,3.0.1) affected Fixed in OpenSSL 1.1.1n (Affected 1.1.1-1.1.1m) affected Fixed in OpenSSL 1.0.2zd (Affected 1.0.2-1.0.2zc)
|
Is my server affected?
Find the installed version of openssl and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i openssl
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2022-0778 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2022-0778RHEL, Rocky, Alma, Fedora
rpm -q openssl
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2022-0778Alpine
apk list --installed | grep -i opensslWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2022-0778
trivy image --scanners vuln IMAGE | grep CVE-2022-0778
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- DSA-5103 debian.org · vendor advisory
- FEDORA-2022-a5f51502f0 lists.fedoraproject.org · vendor advisory
- FEDORA-2022-9e88b5d8d7 lists.fedoraproject.org · vendor advisory
- FEDORA-2022-8bb51f6901 lists.fedoraproject.org · vendor advisory
- GLSA-202210-02 security.gentoo.org · vendor advisory
Other references
- https://www.openssl.org/news/secadv/20220315.txt openssl.org
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=a466912611aa6cbdf550cd10601390e587451246 git.openssl.org
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=3118eb64934499d93db3230748a452351d1d9a65 git.openssl.org
- https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=380085481c64de749a6dd25cdf0bcf4360b30f83 git.openssl.org
- [debian-lts-announce] 20220317 [SECURITY] [DLA 2952-1] openssl security update lists.debian.org · mailing list
- [debian-lts-announce] 20220317 [SECURITY] [DLA 2953-1] openssl1.0 security update lists.debian.org · mailing list
- https://www.oracle.com/security-alerts/cpuapr2022.html oracle.com
- https://security.netapp.com/advisory/ntap-20220321-0002/ security.netapp.com
- https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2022-0002 psirt.global.sonicwall.com
- https://www.tenable.com/security/tns-2022-06 tenable.com
- https://www.tenable.com/security/tns-2022-07 tenable.com
- https://www.tenable.com/security/tns-2022-08 tenable.com
17 more
- 20220516 APPLE-SA-2022-05-16-4 Security Update 2022-004 Catalina seclists.org · mailing list
- 20220516 APPLE-SA-2022-05-16-3 macOS Big Sur 11.6.6 seclists.org · mailing list
- 20220516 APPLE-SA-2022-05-16-2 macOS Monterey 12.4 seclists.org · mailing list
- https://www.oracle.com/security-alerts/cpujul2022.html oracle.com
- https://support.apple.com/kb/HT213257 support.apple.com
- https://support.apple.com/kb/HT213256 support.apple.com
- https://support.apple.com/kb/HT213255 support.apple.com
- https://www.tenable.com/security/tns-2022-09 tenable.com
- https://security.netapp.com/advisory/ntap-20220429-0005/ security.netapp.com
- http://packetstormsecurity.com/files/167344/OpenSSL-1.0.2-1.1.1-3.0-BN_mod_sqrt-Infinite-Loop.html packetstormsecurity.com
- https://cert-portal.siemens.com/productcert/pdf/ssa-712929.pdf cert-portal.siemens.com
- https://security.netapp.com/advisory/ntap-20240621-0006/ security.netapp.com
- https://cert-portal.siemens.com/productcert/html/ssa-712929.html cert-portal.siemens.com
- https://cert-portal.siemens.com/productcert/html/ssa-398330.html cert-portal.siemens.com
- https://cert-portal.siemens.com/productcert/html/ssa-108696.html cert-portal.siemens.com
- https://cert-portal.siemens.com/productcert/html/ssa-028723.html cert-portal.siemens.com
- https://cert-portal.siemens.com/productcert/html/ssa-019200.html cert-portal.siemens.com
Source: the record CVE-2022-0778 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse