Executive brief
OpenSSL is a widely used security library that provides encryption and secure communication for many applications and operating systems. A flaw in how it validates certain RSA security keys can cause the system to spend an excessive amount of time on complex mathematical calculations. An attacker could exploit this by providing a specially crafted, invalid key, causing the application to become unresponsive and leading to a denial-of-service (DoS) condition.
Technical details
A vulnerability exists in OpenSSL's RSA public key validation logic within the EVP_PKEY_public_check() function. When checking a public key, the library performs a primality test (Miller-Rabin) to confirm the RSA modulus is composite. If an attacker supplies an RSA key where the modulus is an extremely large prime number, the computation takes an excessive amount of time because there was previously no limit on the modulus size or the number of Miller-Rabin rounds for this specific check. This can be triggered via the 'pkey' command-line tool or any application using the affected function on untrusted keys. The fix introduces a 16,384-bit limit (OPENSSL_RSA_MAX_MODULUS_BITS) and caps the Miller-Rabin rounds to five.
Affected products
- OpenSSL Foundation OpenSSL 3.0.0 to 3.0.12, 3.1.0 to 3.1.4, 3.2.0
Timeline
- 2023-11-02: disclosed: Reported by OSS-Fuzz
- 2024-01-15: advisory: OpenSSL security advisory published
- 2024-04-25: other: NVD record published
References
- https://github.com/openssl/openssl/commit/0b0f7abfb37350794a4b8960fafc292cd5d1b84d
- https://github.com/openssl/openssl/commit/18c02492138d1eb8b6548cb26e7b625fb2414a2a
- https://github.com/openssl/openssl/commit/a830f551557d3d66a84bbb18a5b889c640c36294
- https://www.openssl.org/news/secadv/20240115.txt
- http://www.openwall.com/lists/oss-security/2024/03/11/1
- https://security.netapp.com/advisory/ntap-20240531-0007/
- https://cert-portal.siemens.com/productcert/html/ssa-265688.html