CVE-2022-0778
openssl: Infinite loop in BN_mod_sqrt() reachable when parsing certificates
Overview
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).
Source: OX vulnerability database
Severity
7.5 · HIGH
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness: CWE-835
Affected packages · 10
| Ecosystem | Package | Vulnerable | Fixed in |
|---|---|---|---|
| Bitnami | mariadb | >=10.2.0, <10.2.42>=10.3.0, <10.3.33>=10.4.0, <10.4.23>=10.5.0, <10.5.14>=10.6.0, <10.6.6+1 more | 10.2.4210.3.3310.4.2310.5.1410.6.6 |
| Bitnami | mariadb-min | >=10.2.0, <10.2.42>=10.3.0, <10.3.33>=10.4.0, <10.4.23>=10.5.0, <10.5.14>=10.6.0, <10.6.6+1 more | 10.2.4210.3.3310.4.2310.5.1410.6.6 |
| Bitnami | mysql-client | >=10.2.0, <10.2.42>=10.3.0, <10.3.33>=10.4.0, <10.4.23>=10.5.0, <10.5.14>=10.6.0, <10.6.6+1 more | 10.2.4210.3.3310.4.2310.5.1410.6.6 |
| Bitnami | node | >=12.0.0, <12.12.1>=12.13.0, <12.22.11>=14.0.0, <14.14.1>=14.15.0, <14.19.1>=16.0.0, <16.12.1+2 more | 12.12.112.22.1114.14.114.19.116.12.1 |
| Bitnami | node-min | >=12.0.0, <12.12.1>=12.13.0, <12.22.11>=14.0.0, <14.14.1>=14.15.0, <14.19.1>=16.0.0, <16.12.1+2 more | 12.12.112.22.1114.14.114.19.116.12.1 |
| Cargo (Rust) | openssl-src | >=300.0.0, <300.0.5<111.18.0 | 300.0.5111.18.0 |
| Conan (C/C++) | openssl | >=1.0.2 <1.0.2zd||>=1.1.0 <1.1.1n||>=3.0.0 <3.0.2 | 1.0.2zd1.1.1n3.0.2 |
| Julia | libnode_jll | <16.17.0+0 | 16.17.0+0 |
| Julia | Openresty_jll | <1.21.4+0 | 1.21.4+0 |
| Julia | OpenSSL_jll | <1.1.14+0 | 1.1.14+0 |
Open a package to see all its vulnerabilities.
Operating systems · 124 fixes
Azure Linux 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 3.0 | edk2 | 0:20240223gitedc6681206c1-1.azl3 |
Oracle Linux 3 releases · 3 packages
| Release | Package | Fixed in |
|---|---|---|
| 7 | openssl +4 | 10:1.0.2k-25.el7_9_fips |
| 7 | openssl +4 | 1:1.0.2k-25.el7_9 |
| 7 | openssl +4 | 2:1.0.2k-25.ksplice1.el7_9 |
| 8 | compat-openssl10 | 1:1.0.2o-4.el8_6 |
| 8 | openssl +3 | 1:1.1.1k-6.el8_5 |
| 8 | openssl +5 | 2:1.1.1k-6.ksplice1.el8_5 |
1 more row
Photon OS 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 4.0 | openssl +4 | 3.0.0-5.ph4 |
Red Hat 3 releases · 19 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 7 | jbcs-httpd24-openssl-pkcs11 | 0:0.4.10-26.jbcs.el7 | RHSA-2022:1389 |
| 7 | jbcs-httpd24-openssl-chil | 0:1.0.0-11.jbcs.el7 | RHSA-2022:1389 |
| 7 | jbcs-httpd24-mod-http2 | 0:1.15.7-22.jbcs.el7 | RHSA-2022:1389 |
| 7 | jws5-tomcat-native | 0:1.2.30-4.redhat_4.el7jws | RHSA-2022:1519 |
| 7 | jbcs-httpd24-mod-jk-ap24 +1 | 0:1.2.48-29.redhat_1.jbcs.el7 | RHSA-2022:1389 |
| 7 | jbcs-httpd24-mod-cluster-native | 0:1.3.16-10.Final_redhat_2.jbcs.el7 | RHSA-2022:1389 |
37 more rows
SUSE Linux Enterprise 1 release · 3 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 12.5 | libopenssl0-9-8 | 0.9.8j-106.33.1 | SUSE-SU-2022:0859-1 |
| 12.5 | libopenssl-1-0-0-devel +7 | 1.0.2p-3.48.1 | SUSE-SU-2022:0857-1 |
| 12.5 | libopenssl-1-1-devel +6 | 1.1.1d-2.61.1 | SUSE-SU-2022:0860-1 |
SUSE Linux Enterprise Micro 1 release · 4 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 5.2 | libopenssl-1-1-devel +3 | 1.1.1d-11.43.1 | SUSE-SU-2022:0861-1 |
| 5.2 | libz1 | 1.2.11-3.26.10 | SUSE-SU-2022:0861-1 |
| 5.2 | glibc +2 | 2.31-150300.20.7 | SUSE-SU-2022:0861-1 |
| 5.2 | libcrypt1 | 4.4.15-150300.4.2.41 | SUSE-SU-2022:0861-1 |
alma 1 release · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| 8 | compat-openssl10 | 1:1.0.2o-4.el8_6 |
| 8 | openssl +3 | 1:1.1.1k-6.el8_5 |
alpine 4 releases · 5 packages
| Release | Package | Fixed in |
|---|---|---|
| 3.22 | openjdk11 | 11.0.15_p10-r0 |
| 3.22 | lighthouse | 2.2.0-r0 |
| 3.22 | openssl | 3.0.2-r0 |
| 3.22 | libressl | 3.4.3-r0 |
| 3.22 | libretls | 3.5.1-r0 |
| 3.23 | openjdk11 | 11.0.15_p10-r0 |
14 more rows
amazon linux 1 release · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| 2023 | openssl +6 | 1:3.0.5-1.amzn2023.0.4 |
| 2023 | mariadb105 +27 | 3:10.5.16-1.amzn2023.0.7 |
debian 6 releases · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| 10 | openssl | 1.1.1d-0+deb10u8 |
| 11 | openssl | 1.1.1k-1+deb11u2 |
| 12 | openssl | 1.1.1n-1 |
| 13 | openssl | 1.1.1n-1 |
| 14 | openssl | 1.1.1n-1 |
| 9 | openssl1-0 | 1.0.2u-1~deb9u7 |
1 more row
echo 1 release · 5 packages
| Release | Package | Fixed in |
|---|---|---|
| openssl-1-0-1g | 1.0.1g+e1 | |
| openssl-1-1-1c | 1.1.1c+e1 | |
| openssl-1-1-1g | 1.1.1g+e1 | |
| openssl-1-1-1k | 1.1.1k+e1 | |
| openssl | 1.1.1n-1 |
openSUSE 1 release · 6 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Tumbleweed | python310-ecdsa +2 | 0.18.0-1.1 | openSUSE-SU-2024:12444-1 |
| Tumbleweed | python311-ecdsa +2 | 0.19.1-1.1 | openSUSE-SU-2025:14965-1 |
| Tumbleweed | libopenssl-1-1-devel +7 | 1.1.1n-1.1 | openSUSE-SU-2024:11933-1 |
| Tumbleweed | cargo-audit-advisory-db | 20220323-1.1 | openSUSE-SU-2024:11953-1 |
| Tumbleweed | libopenssl-3-devel +5 | 3.0.2-1.1 | openSUSE-SU-2024:11927-1 |
| Tumbleweed | libcrypto47 +9 | 3.4.3-1.1 | openSUSE-SU-2024:11944-1 |
rocky 2 releases · 3 packages
| Release | Package | Fixed in |
|---|---|---|
| 8 | compat-openssl10 | 1:1.0.2o-4.el8_6 |
| 8 | openssl +3 | 1:1.1.1k-6.el8_5 |
| 9 | compat-openssl11 | 1:1.1.1k-4.el9_0 |
root.io alpine 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 3.23 | rootio-openssl | 3.0.2-r0 |
root.io debian 2 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 11 | rootio-openssl | 1.1.1k-1+deb11u2 |
| 12 | rootio-openssl | 1.1.1n-1 |
seal Red Hat 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 7 | openssl +1 | 1:1.0.2k-25.el7_9+sp999 |
| 7 | openssl +1 | 1:1.0.2k-26.el7_9+sp999 |
ubuntu 7 releases · 4 packages
| Release | Package | Fixed in |
|---|---|---|
| 18.04 | openssl1-0 | 1.0.2n-1ubuntu5.8 |
| 18.04 | openssl | 1.1.1-1ubuntu2.1~18.04.15 |
| 18.04-ESM | edk2 | affected |
| 18.04-ESM | openssl1-0 | 1.0.2n-1ubuntu5.8 |
| 18.04-ESM | openssl | 1.1.1-1ubuntu2.1~18.04.15 |
| 20.04 | openssl | 1.1.1f-1ubuntu2.12 |
7 more rows
chainguard 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| ruby-3-1 | not affected |
wolfi 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| ruby-3-1 | not affected |
References
- packetstormsecurity.com http://packetstormsecurity.com/files/167344/OpenSSL-1.0.2-1.1.1-3.0-BN_mod_sqrt-Infinite-Loop.html
- seclists.org http://seclists.org/fulldisclosure/2022/May/33
- seclists.org http://seclists.org/fulldisclosure/2022/May/35
- seclists.org http://seclists.org/fulldisclosure/2022/May/38
- access.redhat.com https://access.redhat.com/errata/RHSA-2022:5326
- access.redhat.com https://access.redhat.com/security/cve/CVE-2022-0778
- bugzilla.redhat.com https://bugzilla.redhat.com/2062202
- bugzilla.redhat.com https://bugzilla.redhat.com/show_bug.cgi?id=2062202
- cert-portal.siemens.com https://cert-portal.siemens.com/productcert/html/ssa-019200.html
- cert-portal.siemens.com https://cert-portal.siemens.com/productcert/html/ssa-028723.html
Show all 63 references
- 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-398330.html
- cert-portal.siemens.com https://cert-portal.siemens.com/productcert/html/ssa-712929.html
- cert-portal.siemens.com https://cert-portal.siemens.com/productcert/pdf/ssa-712929.pdf
- cve.mitre.org https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0778
- errata.almalinux.org https://errata.almalinux.org/8/ALSA-2022-5326.html
- errata.rockylinux.org https://errata.rockylinux.org/RLSA-2022:5326
- 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 https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=a466912611aa6cbdf550cd10601390e587451246
- git.openssl.org https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=3118eb64934499d93db3230748a452351d1d9a65
- git.openssl.org https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=380085481c64de749a6dd25cdf0bcf4360b30f83
- git.openssl.org https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=a466912611aa6cbdf550cd10601390e587451246
- github.com https://github.com/advisories/GHSA-x3mh-jvjw-3xwx
- linux.oracle.com https://linux.oracle.com/cve/CVE-2022-0778.html
- linux.oracle.com https://linux.oracle.com/errata/ELSA-2022-9272.html
- lists.debian.org https://lists.debian.org/debian-lts-announce/2022/03/msg00023.html
- lists.debian.org https://lists.debian.org/debian-lts-announce/2022/03/msg00024.html
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/323SNN6ZX7PRJJWP2BUAFLPUAE42XWLZ
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/323SNN6ZX7PRJJWP2BUAFLPUAE42XWLZ/
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GDB3GQVJPXJE7X5C5JN6JAA4XUDWD6E6
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GDB3GQVJPXJE7X5C5JN6JAA4XUDWD6E6/
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/W6K3PR542DXWLEFFMFIDMME4CWMHJRMG
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/W6K3PR542DXWLEFFMFIDMME4CWMHJRMG/
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/323SNN6ZX7PRJJWP2BUAFLPUAE42XWLZ
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GDB3GQVJPXJE7X5C5JN6JAA4XUDWD6E6
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/W6K3PR542DXWLEFFMFIDMME4CWMHJRMG
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2022-0778
- psirt.global.sonicwall.com https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2022-0002
- rustsec.org https://rustsec.org/advisories/RUSTSEC-2022-0014.html
- security.gentoo.org https://security.gentoo.org/glsa/202210-02
- security.netapp.com https://security.netapp.com/advisory/ntap-20220321-0002
- security.netapp.com https://security.netapp.com/advisory/ntap-20220321-0002/
- security.netapp.com https://security.netapp.com/advisory/ntap-20220429-0005
- security.netapp.com https://security.netapp.com/advisory/ntap-20220429-0005/
- security.netapp.com https://security.netapp.com/advisory/ntap-20240621-0006
- security.netapp.com https://security.netapp.com/advisory/ntap-20240621-0006/
- support.apple.com https://support.apple.com/kb/HT213255
- support.apple.com https://support.apple.com/kb/HT213256
- support.apple.com https://support.apple.com/kb/HT213257
- ubuntu.com https://ubuntu.com/security/notices/USN-5328-1
- ubuntu.com https://ubuntu.com/security/notices/USN-5328-2
- ubuntu.com https://ubuntu.com/security/notices/USN-6457-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7894-1
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2022-0778
- www.debian.org https://www.debian.org/security/2022/dsa-5103
- www.openssl.org https://www.openssl.org/news/secadv/20220315.txt
- www.oracle.com https://www.oracle.com/security-alerts/cpuapr2022.html
- www.oracle.com https://www.oracle.com/security-alerts/cpujul2022.html
- www.tenable.com https://www.tenable.com/security/tns-2022-06
- www.tenable.com https://www.tenable.com/security/tns-2022-07
- www.tenable.com https://www.tenable.com/security/tns-2022-08
- www.tenable.com https://www.tenable.com/security/tns-2022-09
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.