CVE-2022-40735
High · 7.5CVSS
7.5
EPSS
2.6%
Published
Nov 14, 2022
CISA due date
—
Cloudanix analysis
Some encryption handshakes can be tricked into doing far more work than needed, letting an attacker slow down or crash the server without needing any special access.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Denial of service
- Remediation
- Config Change
- Effort
- Low
- Patch risk
- Low
What it actually does
Allows remote clients to force a server performing Diffie-Hellman key exchange to perform modular exponentiation with unnecessarily long private exponents, resulting in high CPU consumption and potential denial of service.
Why it matters to the business
Attackers can exhaust server CPU resources during TLS, SSH or IKE handshakes, leading to degraded performance or outages for services relying on Diffie-Hellman key exchange; the issue has been public for nearly four years with no official fixes listed.
How an attack unfolds
An attacker initiates a key-exchange handshake and supplies Diffie-Hellman parameters that trigger the server to use a long private exponent; repeated handshakes cause sustained high CPU load, and the flaw can be combined with CVE-2002-20001 for amplified impact.
How to fix it
Configure cryptographic libraries and servers to enforce short exponents together with appropriate subgroup constraints; disable DHE ciphersuites that permit long exponents; monitor upstream library updates for any future patches addressing exponent-size validation.
How to confirm the fix worked
Review server configuration and source code to confirm that DHE private exponents are limited to recommended bit lengths and that subgroup order validation is present; perform load testing with crafted DHE handshakes to verify CPU usage remains bounded.
Typical attack path
- Connect to a service that negotiates DHE ciphersuites
- Send ClientHello (TLS) or equivalent with DHE parameters lacking subgroup constraints
- Force the server to compute modular exponentiation using a long exponent
- Repeat the handshake at high rate to consume CPU resources
- Optionally combine with non-public-key parameter manipulation for greater effect
How to detect it
Look in application and system logs for unusually high volumes of DHE handshakes, spikes in CPU usage during key exchange, or repeated connections from the same sources that terminate after the key-exchange phase; correlate with crypto library debug logs showing large exponent sizes.
What your security team should do
- Audit all services using DHE key exchange and disable weak ciphersuites immediately
- Implement rate limiting and connection throttling on handshake endpoints
- Add CPU and cryptographic-operation monitoring to detect anomalous load
- Track library and protocol updates for any future remediation of long-exponent handling
The record
The Diffie-Hellman Key Agreement Protocol allows use of long exponents that arguably make certain calculations unnecessarily expensive, because the 1996 van Oorschot and Wiener paper found that "(appropriately) short exponents" can be used when there are adequate subgroup constraints, and these short exponents can lead to less expensive calculations than for long exponents. This issue is different from CVE-2002-20001 because it is based on an observation about exponent size, rather than an observation about numbers that are not public keys. The specific situations in which calculation expense would constitute a server-side vulnerability depend on the protocol (e.g., TLS, SSH, or IKE) and the DHE implementation details. In general, there might be an availability concern because of server-side resource consumption from DHE modular-exponentiation calculations. Finally, it is possible for an attacker to exploit this vulnerability and CVE-2002-20001 together.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| SUSE:Linux Enterprise Module for Basesystem 15 SP4 | openssl-3 | 0 | 3.0.8-150400.4.26.1 |
| Ubuntu:20.04:LTS | openssl | 0 | 1.1.1f-1ubuntu2.22 |
| Ubuntu:22.04:LTS | nodejs | 0 | No fix |
| Ubuntu:22.04:LTS | openssl | 0 | 3.0.2-0ubuntu1.16 |
| Ubuntu:24.04:LTS | openssl | 0 | 3.0.13-0ubuntu3 |
| Ubuntu:24.10 | openssl | 0 | 3.0.13-0ubuntu3 |
| Ubuntu:Pro:22.04:LTS | nodejs | 0 | No fix |
| Ubuntu:Pro:FIPS-preview:22.04:LTS | openssl | 0 | No fix |
| Ubuntu:Pro:FIPS-updates:22.04:LTS | openssl | 0 | 3.0.2-0ubuntu1.16+Fips1 |
| openSUSE:Leap 15.4 | openssl-3 | 0 | 3.0.8-150400.4.26.1 |
Related vulnerabilities
- CVE-2023-5678 Issue summary: Generating excessively long X9.42 DH keys or checking excessively long… Also affects openssl-3
- CVE-2023-5363 Issue summary: A bug has been identified in the processing of key and initialisation… Also affects openssl-3
- CVE-2022-3786 A buffer overrun can be triggered in X.509 certificate verification, specifically in name… Also affects openssl-3
- CVE-2022-3602 A buffer overrun can be triggered in X.509 certificate verification, specifically in name… Also affects openssl-3
- CVE-2024-13176 Issue summary: A timing side-channel which could potentially allow recovering the private… Also affects openssl
- CVE-2024-4741 Issue summary: Calling the OpenSSL API function SSL_free_buffers may cause memory to be… Also affects openssl
- CVE-2024-9143 Issue summary: Use of the low-level GF(2^m) elliptic curve APIs with untrusted explicit… Also affects openssl
- CVE-2024-5535 Issue summary: Calling the OpenSSL API function SSL_select_next_proto with an empty… Also affects openssl