CVE-2022-0778 — openssl-src
HIGHCVE-2022-0778 is a high-severity (CVSS 7.5) CWE-835 vulnerability in openssl-src. 6 public exploit references exist, so weaponization risk is real. A fix is available for openssl-src — see the affected versions and patch details below.
Infinite loop in BN_mod_sqrt() reachable when parsing certificates
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2022-0778.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2022-0778 by exploitation likelihood (EPSS) against impact (CVSS). In the shaded patch-first corner (EPSS 50%+, CVSS 7.0+).
Where this sits among everything scored
Of 385,738 CVEs with a current EPSS score, this one falls in the 50–90% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
openssl-src🦀openssl-srcReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
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 Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | openssl-src | ≥ 300.0.0&&< 300.0.5 | 300.0.5cargo update -p openssl-src --precise 300.0.5 |
| 🦀crates.io | openssl-src | all versions | 111.18.0cargo update -p openssl-src --precise 111.18.0 |
Affected Products
debian linuxdebianfedorafedoraprojectmariadbmariadb500f firmwarenetappa250 firmwarenetappcloud volumes ontap mediatornetappResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for openssl-src, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update openssl-src to 300.0.5 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-0778 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
While Red Hat initially stated not to be directly affected by this flaw, after further investigation we found that the versions of OpenSSL as shipped in Red Hat Enterprise Linux 6, 7, and 8 are vulnerable to a denial of service attack through malicious Elliptic Curve parameters. During processing of the parameters…
Red Hat has investigated whether a possible mitigation exists for this issue, and has not been able to identify a practical example. Please update the affected package as soon as possible.Source: Red Hat security advisory for CVE-2022-0778 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| JBoss Core Services for RHEL 8 | jbcs-httpd24-apr-util-0:1.6.1-91.el8jbcs | RHSA-2022:1389 |
| Red Hat Enterprise Linux 6 Extended Lifecycle Support | openssl-0:1.0.1e-60.el6_10 | RHSA-2022:1073 |
| Red Hat Enterprise Linux 7 | openssl-1:1.0.2k-25.el7_9 | RHSA-2022:1066 |
| Red Hat Enterprise Linux 7.3 Advanced Update Support | openssl-1:1.0.1e-62.el7_3 | RHSA-2022:1082 |
| Red Hat Enterprise Linux 7.4 Advanced Update Support | openssl-1:1.0.2k-10.el7_4 | RHSA-2022:1076 |
| Red Hat Enterprise Linux 7.6 Advanced Update Support | openssl-1:1.0.2k-18.el7_6 | RHSA-2022:1078 |
| Red Hat Enterprise Linux 7.7 Advanced Update Support | openssl-1:1.0.2k-21.el7_7 | RHSA-2022:1077 |
| Red Hat Enterprise Linux 8 | compat-openssl10-1:1.0.2o-4.el8_6 | RHSA-2022:5326 |
Frequently Asked Questions
Is CVE-2022-0778 in your dependencies?
Find it across crates.io, including transitive dependencies.