Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2022-0778

HIGH 7.5PoCEPSS 99%

Infinite loop in BN_mod_sqrt() reachable when parsing certificates

Also known as BIT-mariadb-2022-0778, BIT-mariadb-min-2022-0778, BIT-mysql-client-2022-0778, BIT-node-2022-0778, BIT-node-min-2022-0778, GHSA-x3mh-jvjw-3xwx, RUSTSEC-2022-0014

Mitigation

  • Upgrade openssl-src to one of 300.0.5, 111.18.0 (or later in the same release line).

Who should check

  • Projects that depend on crates.io package openssl-src (>= 300.0.0, < 300.0.5)
  • Anyone running OpenSSL 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)

Vulnerability facts

Affected
openssl-src >= 300.0.0, < 300.0.5
Fixed in
300.0.5, 111.18.0
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
Yes: see the exploit references below
Remote exploitation
Remote, no login needed
CVSS
7.5 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: Low
  • Privileges required: None
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: None
  • Integrity impact: None
  • Availability impact: High
EPSS
52.57% chance of exploitation in 30 days (percentile 99, 2026-11-26)
CWE
CWE-835
Published
Modified

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 and fixed versions

Package / productAffectedFixedSource
crates.io openssl-src>= 300.0.0, < 300.0.5300.0.5, 111.18.0osv
OpenSSLFixed 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)—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2022-0778. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-0778.md
Affected: openssl-src >= 300.0.0, < 300.0.5
Fixed in: 300.0.5, 111.18.0

Steps:
1. Search this machine and project for openssl-src (crates.io), OpenSSL: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

Other

FAQ

Is CVE-2022-0778 being exploited?

There is no confirmed exploitation: CVE-2022-0778 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 52.57% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2022-0778?

High: CVSS 7.5 (v3.1, scored by CNA). Remote, no login needed.

Which versions are affected by CVE-2022-0778?

openssl-src >= 300.0.0, < 300.0.5.

Is there a fix for CVE-2022-0778?

Yes. Fixed in 300.0.5, 111.18.0. Upgrade openssl-src to one of 300.0.5, 111.18.0 (or later in the same release line).

How do I check if I'm affected by CVE-2022-0778?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors