GHSA-x3mh-jvjw-3xwx BIT-mariadb-2022-0778 BIT-mariadb-min-2022-0778 BIT-mysql-client-2022-0778 BIT-node-2022-0778 BIT-node-min-2022-0778 CVE-2022-0778 RUSTSEC-2022-0014
openssl-src's infinite loop in `BN_mod_sqrt()` reachable when parsing certificates
- Severity
- 7.5 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 73.19%
- Chance of exploitation in the next 30 days. Higher than 99.46% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-835 Loop with Unreachable Exit Condition ('Infinite Loop')
- Fix
300.0.5- Upgrade openssl-src to this version or later
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 versions
crates.io
| Package | Vulnerable | Fixed in |
|---|---|---|
| openssl-src | >= 300.0.0, < 300.0.5 |
300.0.5 |
| openssl-src | < 111.18.0 |
111.18.0 |
| openssl-src | >= 0.0.0-0, < 111.18.0>= 300.0.0, < 300.0.5 |
111.18.0300.0.5 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
openssl-src crates.io → 300.0.5
- cargo
cargo update -p openssl-src --precise 300.0.5
Severity breakdown
CVSS 3.1 7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Weakness
CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.
References
Advisories
Packages
Other links
- rustsec.org/advisories/RUSTSEC-2022-0014.html
- security.gentoo.org/glsa/202210-02
- security.netapp.com/advisory/ntap-20220321-0002
- security.netapp.com/advisory/ntap-20220429-0005
- security.netapp.com/advisory/ntap-20240621-0006
- support.apple.com/kb/HT213255
- support.apple.com/kb/HT213256
- support.apple.com/kb/HT213257
- debian.org/security/2022/dsa-5103
- openssl.org/news/secadv/20220315.txt
- oracle.com/security-alerts/cpuapr2022.html
- oracle.com/security-alerts/cpujul2022.html
- tenable.com/security/tns-2022-06
- tenable.com/security/tns-2022-07
- tenable.com/security/tns-2022-08
- tenable.com/security/tns-2022-09
- psirt.global.sonicwall.com/vuln-detail/SNWLID-2022-0002
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/W6K3P…
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GDB3G…
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/323SN…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/W6K…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GDB…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/323…
- lists.debian.org/debian-lts-announce/2022/03/msg00024.html
- lists.debian.org/debian-lts-announce/2022/03/msg00023.html
- git.openssl.org/gitweb
- git.openssl.org/gitweb
- git.openssl.org/gitweb
- git.openssl.org/gitweb
- git.openssl.org/gitweb
- git.openssl.org/gitweb
- cert-portal.siemens.com/productcert/pdf/ssa-712929.pdf
- packetstormsecurity.com/files/167344/OpenSSL-1.0.2-1.1.1-3.0-BN_mod_sqrt-Infinite-Loop.html
- seclists.org/fulldisclosure/2022/May/33
- seclists.org/fulldisclosure/2022/May/35
- seclists.org/fulldisclosure/2022/May/38
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/323…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GDB…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/W6K…
- security.netapp.com/advisory/ntap-20240621-0006
- cert-portal.siemens.com/productcert/html/ssa-019200.html
- cert-portal.siemens.com/productcert/html/ssa-028723.html
- cert-portal.siemens.com/productcert/html/ssa-108696.html
- cert-portal.siemens.com/productcert/html/ssa-398330.html
- cert-portal.siemens.com/productcert/html/ssa-712929.html
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-w67w-mw4j-8qrv openssl-src contains Read Buffer Overflow in X.509 Name Constraint | Medium | Also affects openssl-src |
| GHSA-vrh7-x64v-7vxq openssl-src contains `NULL` dereference during PKCS7 data verification | High | Also affects openssl-src |
| GHSA-vxrh-cpg7-8vjr openssl-src subject to NULL dereference validating DSA public key | High | Also affects openssl-src |
| GHSA-r7jw-wp68-3xch openssl-src vulnerable to Use-after-free following `BIO_new_NDEF` | High | Also affects openssl-src |
| GHSA-v5w6-wcm8-jm4q openssl-src contains Double free after calling `PEM_read_bio_ex` | High | Also affects openssl-src |
| GHSA-p52g-cm5j-mjv4 openssl-src subject to Timing Oracle in RSA Decryption | Medium | Also affects openssl-src |
| GHSA-29xx-hcv2-c4cp openssl-src subject to Invalid pointer dereference in `d2i_PKCS7` functions | High | Also affects openssl-src |
| GHSA-x4qr-2fvf-3mr5 Vulnerable OpenSSL included in cryptography wheels | High | Also affects openssl-src |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor