{"id":"CVE-2022-0778","published":"2022-03-15T17:05:20Z","modified":"2026-10-14T12:12:36Z","title":"Infinite loop in BN_mod_sqrt() reachable when parsing certificates","vendor":"OpenSSL","product":"OpenSSL","tier":"core","eol":null,"affectedVersions":[{"vendor":"OpenSSL","product":"OpenSSL","versions":["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)"]}],"description":{"text":"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).","provenance":"source","from":"CVE.org"},"summary":{"text":"A flaw in OpenSSL's BN_mod_sqrt() function, which computes modular square roots for non-prime moduli, causes it to loop forever when it is reached while parsing certificates with compressed-form elliptic curve public keys or explicit curve parameters, and also when parsing crafted private keys. An attacker who can supply a crafted certificate or key to any process that parses it, such as a TLS endpoint or certificate authority, can trigger the hang over the network with no authentication or user interaction, since parsing occurs before signature verification.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-10-29T07:11:46Z"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.73188,"percentile":0.99455,"date":"2026-10-29","provenance":"source"},"kev":null,"vulncheckKev":null,"exploited":false,"otx":{"pulseCount":32,"pulses":[{"name":"Clone Credit: Disable_Duck 3years ago | Title: Investigation of Distribution Vectors and Threat Net","url":"https://otx.alienvault.com/pulse/6a769ea2d982f518da8706ad","created":"2026-08-08"},{"name":"Clone Credit: Disable_Duck 3years ago | Title: Investigation of Distribution Vectors and Threat Net","url":"https://otx.alienvault.com/pulse/6a769e9cd982f518da8706ac","created":"2026-08-08"},{"name":"Clone Credit: Disable_Duck 3years ago | Title: Investigation of Distribution Vectors and Threat Net","url":"https://otx.alienvault.com/pulse/6a769e949865f83acda96106","created":"2026-08-08"},{"name":"Clone Credit: Disable_Duck 3years ago | Title: Investigation of Distribution Vectors and Threat Net","url":"https://otx.alienvault.com/pulse/6a769e1a969020a0a27fdadb","created":"2026-08-08"},{"name":"Clone Credit: Disable_Duck 3years ago | Title: Investigation of Distribution Vectors and Threat Net","url":"https://otx.alienvault.com/pulse/6a769ddbd7a90ef4c4ee24b1","created":"2026-08-08"},{"name":"Clone Credit: Disable_Duck 3years ago | Title: Investigation of Distribution Vectors and Threat Net","url":"https://otx.alienvault.com/pulse/6a769ddbeb4aea06bbbff46b","created":"2026-08-08"},{"name":"Clone Credit: Disable_Duck 3years ago | Title: Investigation of Distribution Vectors and Threat Net","url":"https://otx.alienvault.com/pulse/6a769dd0a1cc8c3e72d510bd","created":"2026-08-08"},{"name":"Clone Credit: Disable_Duck 3years ago | Title: Investigation of Distribution Vectors and Threat Net","url":"https://otx.alienvault.com/pulse/6a769dc4a1a62217b180c1c1","created":"2026-08-08"},{"name":"Clone Credit: Disable_Duck 3years ago | Title: Investigation of Distribution Vectors and Threat Net","url":"https://otx.alienvault.com/pulse/6a769dc4b149813b84cb9764","created":"2026-08-08"},{"name":"Clone Credit: Disable_Duck 3years ago | Title: Investigation of Distribution Vectors and Threat Net","url":"https://otx.alienvault.com/pulse/6a769dc16458c2be21fd002e","created":"2026-08-08"}],"provenance":"machine"},"cwes":[{"id":"CWE-835","name":"Loop with Unreachable Exit Condition"}],"references":[{"url":"https://www.openssl.org/news/secadv/20220315.txt","tags":[]},{"url":"https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=a466912611aa6cbdf550cd10601390e587451246","tags":[]},{"url":"https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=3118eb64934499d93db3230748a452351d1d9a65","tags":[]},{"url":"https://git.openssl.org/gitweb/?p=openssl.git%3Ba=commitdiff%3Bh=380085481c64de749a6dd25cdf0bcf4360b30f83","tags":[]},{"url":"https://www.debian.org/security/2022/dsa-5103","tags":["vendor-advisory"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/03/msg00023.html","tags":["mailing-list"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/03/msg00024.html","tags":["mailing-list"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GDB3GQVJPXJE7X5C5JN6JAA4XUDWD6E6/","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/323SNN6ZX7PRJJWP2BUAFLPUAE42XWLZ/","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/W6K3PR542DXWLEFFMFIDMME4CWMHJRMG/","tags":["vendor-advisory"]},{"url":"https://www.oracle.com/security-alerts/cpuapr2022.html","tags":[]},{"url":"https://security.netapp.com/advisory/ntap-20220321-0002/","tags":[]},{"url":"https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2022-0002","tags":[]},{"url":"https://www.tenable.com/security/tns-2022-06","tags":[]},{"url":"https://www.tenable.com/security/tns-2022-07","tags":[]},{"url":"https://www.tenable.com/security/tns-2022-08","tags":[]},{"url":"http://seclists.org/fulldisclosure/2022/May/33","tags":["mailing-list"]},{"url":"http://seclists.org/fulldisclosure/2022/May/35","tags":["mailing-list"]},{"url":"http://seclists.org/fulldisclosure/2022/May/38","tags":["mailing-list"]},{"url":"https://www.oracle.com/security-alerts/cpujul2022.html","tags":[]},{"url":"https://support.apple.com/kb/HT213257","tags":[]},{"url":"https://support.apple.com/kb/HT213256","tags":[]},{"url":"https://support.apple.com/kb/HT213255","tags":[]},{"url":"https://www.tenable.com/security/tns-2022-09","tags":[]},{"url":"https://security.netapp.com/advisory/ntap-20220429-0005/","tags":[]},{"url":"http://packetstormsecurity.com/files/167344/OpenSSL-1.0.2-1.1.1-3.0-BN_mod_sqrt-Infinite-Loop.html","tags":[]},{"url":"https://cert-portal.siemens.com/productcert/pdf/ssa-712929.pdf","tags":[]},{"url":"https://security.gentoo.org/glsa/202210-02","tags":["vendor-advisory"]},{"url":"https://security.netapp.com/advisory/ntap-20240621-0006/","tags":[]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-712929.html","tags":[]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-398330.html","tags":[]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-108696.html","tags":[]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-028723.html","tags":[]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-019200.html","tags":[]}],"techniques":[],"reports":[],"affected":[{"ecosystem":"crates.io","package":"openssl-src","vulnerableRanges":[">=300.0.0, <300.0.5","<111.18.0",">=0.0.0-0, <111.18.0"],"patched":["300.0.5","111.18.0"],"from":["GHSA-x3mh-jvjw-3xwx","RUSTSEC-2022-0014"],"provenance":"source"}],"advisories":[{"id":"GHSA-x3mh-jvjw-3xwx","url":"https://github.com/advisories/GHSA-x3mh-jvjw-3xwx","severity":"HIGH","ecosystem":"crates.io","package":"openssl-src","vulnerableRanges":[">=300.0.0, <300.0.5"],"patched":["300.0.5"],"provenance":"source","from":"GHSA"},{"id":"GHSA-x3mh-jvjw-3xwx","url":"https://github.com/advisories/GHSA-x3mh-jvjw-3xwx","severity":"HIGH","ecosystem":"crates.io","package":"openssl-src","vulnerableRanges":["<111.18.0"],"patched":["111.18.0"],"provenance":"source","from":"GHSA"}],"euvd":{"id":"EUVD-2022-1575","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2022-1575","exploited":false,"exploitedSince":null,"provenance":"source"},"exploits":[],"exploitSources":{"pocGithub":{"count":5,"skipped":1,"earliest":"2022-03-15","earliestUrl":"https://github.com/drago-96/CVE-2022-0778","repos":[{"name":"drago-96/CVE-2022-0778","url":"https://github.com/drago-96/CVE-2022-0778","stars":182,"created":"2022-03-15"},{"name":"jkakavas/CVE-2022-0778-POC","url":"https://github.com/jkakavas/CVE-2022-0778-POC","stars":11,"created":"2022-04-18"},{"name":"yywing/cve-2022-0778","url":"https://github.com/yywing/cve-2022-0778","stars":9,"created":"2022-04-04"},{"name":"0xUhaw/CVE-2022-0778","url":"https://github.com/0xUhaw/CVE-2022-0778","stars":2,"created":"2022-04-21"},{"name":"jeongjunsoo/CVE-2022-0778","url":"https://github.com/jeongjunsoo/CVE-2022-0778","stars":1,"created":"2023-10-26"}]},"first":{"date":"2022-03-15","source":"PoC-in-GitHub","url":"https://github.com/drago-96/CVE-2022-0778"},"provenance":"source"},"exploitRefs":["http://packetstormsecurity.com/files/167344/OpenSSL-1.0.2-1.1.1-3.0-BN_mod_sqrt-Infinite-Loop.html"],"flow":[],"timeline":[{"date":"2022-03-15","kind":"published","label":"Published (CVE.org)","url":"https://www.cve.org/CVERecord?id=CVE-2022-0778","provenance":"source"},{"date":"2022-03-15","kind":"exploit-public","label":"First public exploit: PoC-in-GitHub","url":"https://github.com/drago-96/CVE-2022-0778","provenance":"source"}],"speed":{"daysToPublicExploit":0,"firstExploitFrom":"PoC-in-GitHub","daysToKev":null},"priority":{"score":33.1,"factors":[{"name":"In a KEV catalog","points":0.0,"detail":"not listed"},{"name":"Recent KEV listing","points":0.0,"detail":"not listed"},{"name":"Known ransomware use","points":0.0,"detail":"not known"},{"name":"EPSS percentile","points":19.89,"detail":"percentile 0.9946"},{"name":"Named in threat reports","points":0.0,"detail":"0 reports"},{"name":"Public exploit code","points":5.0,"detail":"1 NVD exploit link; 5 PoC-in-GitHub repos"},{"name":"Mentioned in OTX pulses","points":3.0,"detail":"32 pulses"},{"name":"CVSS severity","points":5.25,"detail":"base score 7.5"},{"name":"End-of-life product","points":0.0,"detail":"supported or unknown"}]},"lineage":{"packageHistory":[{"cve":"CVE-2021-3711","published":"2021-08-24","fixed":"111.16.0","kev":false},{"cve":"CVE-2021-3712","published":"2021-08-24","fixed":"111.16.0","kev":false},{"cve":"CVE-2021-4044","published":"2021-12-14","fixed":"300.0.4","kev":false,"link":{"from":"CVE-2021-4044","to":"CVE-2022-0778","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"crates.io:openssl-src","fromFixed":"300.0.4","toFixed":"300.0.5","daysApart":91}]}},{"cve":"CVE-2022-0778","published":"2022-03-15","fixed":"300.0.5","kev":false},{"cve":"CVE-2022-1343","published":"2022-05-03","fixed":"300.0.6","kev":false,"link":{"from":"CVE-2022-0778","to":"CVE-2022-1343","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"crates.io:openssl-src","fromFixed":"300.0.5","toFixed":"300.0.6","daysApart":49}]}},{"cve":"CVE-2022-1434","published":"2022-05-03","fixed":"300.0.6","kev":false,"link":{"from":"CVE-2022-0778","to":"CVE-2022-1434","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"crates.io:openssl-src","fromFixed":"300.0.5","toFixed":"300.0.6","daysApart":49}]}},{"cve":"CVE-2022-1473","published":"2022-05-03","fixed":"300.0.6","kev":false,"link":{"from":"CVE-2022-0778","to":"CVE-2022-1473","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"crates.io:openssl-src","fromFixed":"300.0.5","toFixed":"300.0.6","daysApart":49}]}},{"cve":"CVE-2022-2097","published":"2022-07-05","fixed":"300.0.9","kev":false,"link":{"from":"CVE-2022-0778","to":"CVE-2022-2097","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"crates.io:openssl-src","fromFixed":"111.18.0","toFixed":"111.22.0","daysApart":112}]}}],"package":"crates.io:openssl-src"}}