CVE-2022-0778

7.5 HIGH

📋 TL;DR

CVE-2022-0778 is a denial-of-service vulnerability in OpenSSL's BN_mod_sqrt() function that can cause infinite loops when parsing specially crafted certificates or private keys containing invalid elliptic curve parameters. This affects any system using vulnerable OpenSSL versions to parse external certificates, including TLS clients/servers, certificate authorities, and hosting providers. The vulnerability allows attackers to cause service disruption without authentication.

💻 Affected Systems

Products:
  • OpenSSL
Versions: OpenSSL 1.0.2 through 1.0.2zc, 1.1.1 through 1.1.1m, 3.0.0 through 3.0.1
Operating Systems: All operating systems using affected OpenSSL versions
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability triggers during certificate parsing before signature verification, making it exploitable with self-signed certificates. Any application using BN_mod_sqrt() with attacker-controlled parameters is vulnerable.

📦 What is this software?

Openssl by Openssl

OpenSSL is a robust, commercial-grade toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It provides cryptographic functions and is one of the most widely used libraries for implementing secure communications in applications worldwide.

Learn more about Openssl →

Openssl by Openssl

OpenSSL is a robust, commercial-grade toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It provides cryptographic functions and is one of the most widely used libraries for implementing secure communications in applications worldwide.

Learn more about Openssl →

Openssl by Openssl

OpenSSL is a robust, commercial-grade toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It provides cryptographic functions and is one of the most widely used libraries for implementing secure communications in applications worldwide.

Learn more about Openssl →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service outage through resource exhaustion as infinite loops consume 100% CPU, potentially affecting all services using vulnerable OpenSSL for certificate parsing.

🟠

Likely Case

Targeted DoS attacks against specific services that parse external certificates, causing service disruption until processes are restarted.

🟢

If Mitigated

Minimal impact with proper network filtering, certificate validation, and updated OpenSSL versions preventing exploitation.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: CONFIRMED
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires crafting certificates with invalid elliptic curve parameters. Public proof-of-concept code exists and has been weaponized for DoS attacks.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: OpenSSL 1.1.1n, 3.0.2, 1.0.2zd

Vendor Advisory: https://www.openssl.org/news/secadv/20220315.txt

Restart Required: Yes

Instructions:

1. Identify OpenSSL version with 'openssl version'. 2. Update to patched version via package manager: 'apt update && apt upgrade openssl' (Debian/Ubuntu) or 'yum update openssl' (RHEL/CentOS). 3. Restart all services using OpenSSL. 4. Recompile any statically linked applications with updated OpenSSL.

🔧 Temporary Workarounds

Certificate validation filtering

all

Implement certificate validation to reject certificates with explicit elliptic curve parameters before parsing.

Resource limiting

linux

Set CPU time limits on processes that parse certificates to prevent infinite loop exhaustion.

ulimit -t 30
systemctl set-property service-name CPUQuota=50%

🧯 If You Can't Patch

  • Implement network filtering to block untrusted certificate sources at perimeter
  • Deploy monitoring for CPU spikes in certificate parsing processes and implement automated restart policies

🔍 How to Verify

Check if Vulnerable:

Run 'openssl version' and check if version is in affected range: 1.0.2-1.0.2zc, 1.1.1-1.1.1m, 3.0.0-3.0.1

Check Version:

openssl version

Verify Fix Applied:

Confirm version is 1.1.1n or higher, 3.0.2 or higher, or 1.0.2zd or higher with 'openssl version'

📡 Detection & Monitoring

Log Indicators:

  • Processes stuck at 100% CPU usage
  • Certificate parsing timeouts
  • OpenSSL error logs showing certificate parsing failures

Network Indicators:

  • Unusual certificate submissions to TLS endpoints
  • Spike in certificate validation requests from single sources

SIEM Query:

process.cpu.usage:>95 AND process.name:(openssl OR service_using_openssl) AND NOT process.version:(1.1.1n OR 3.0.2 OR 1.0.2zd)

🔗 References

📤 Share & Export