Issue summary: The generic elliptic-curve scalar multiplication used for ECDSA and SM2 signature operations with curves that do not have a dedicated implementation leaks information about the secret nonce through timing.
Last updated 18 August 2025
In situations where an attacker receives automated notification of the success or failure of a decryption attempt an attacker, after sending a very large number of messages to be decrypted, can recover a CMS/PKCS7 transported encryption key or decrypt any RSA encrypted message that was encrypted with the public RSA key, using a Bleichenbacher padding oracle attack. Applications are not affected if they use a certificate together with the private RSA key to the CMSdecrypt or PKCS7decrypt functions to select the correct recipient info to decrypt. Fixed in OpenSSL 1.1.1d (Affected 1.1.1-1.1.1c). Fixed in OpenSSL 1.1.0l (Affected 1.1.0-1.1.0k). Fixed in OpenSSL 1.0.2t (Affected 1.0.2-1.0.2s).
As per OpenSSL upstream:
Historically OpenSSL only ever generated DH parameters based on "safe" primes. More recently (in version 1.0.2) support was provided for generating X9.42 style parameter files such as those required for RFC 5114 support. The primes used in such files may not be "safe". Where an application is using DH configured with parameters based on primes that are not "safe" then an attacker could use this fact to find a peer's private DH exponent. This attack requires that the attacker complete multiple handshakes in which the peer uses the same private DH exponent. For example this could be used to discover a TLS server's private DH exponent if it's reusing the private DH exponent or it's using a static DH ciphersuite.
OpenSSL provides the option SSLOPSINGLEDHUSE for ephemeral DH (DHE) in TLS. It is not on by default. If the option is not set then the server reuses the same private DH exponent for the life of the server process and would be vulnerable to this attack. It is believed that many popular applications do set this option and would therefore not be at risk.
OpenSSL before 1.0.2f will reuse the key if: - SSLCTXsettmpdh()/SSLsettmpdh() is used and SSLOPSINGLEDHUSE is not set. - SSLCTXsettmpdhcallback()/SSLsettmpdhcallback() is used, and both the parameters and the key are set and SSLOPSINGLEDHUSE is not used. This is an undocumted feature and parameter files don't contain the key. - Static DH ciphersuites are used. The key is part of the certificate and so it will always reuse it. This is only supported in 1.0.2.
It will not reused the key for DHE ciphers suites if: - SSLOPSINGLEDHUSE is set - SSLCTXsettmpdhcallback()/SSLsettmpdhcallback() is used and the callback does not provide the key, only the parameters. The callback is almost always used like this.
Non-safe primes are generated by OpenSSL when using: - genpkey with the dhrfc5114 option. This will write a X9.42 style file including the prime-order subgroup size "q". This is supported since the 1.0.2 version. Older versions can't read the file generated by this. - dhparam with the -dsaparam option. This has always been documented as requiring the single use.
The fix for this issue adds an additional check where a "q" parameter is available (as is the case in X9.42 based parameters). This detects the only known attack, and is the only possible defense for static DH ciphersuites.
This could have some performance impact.
Additionally the SSLOPSINGLEDHUSE option has been switched on by default and cannot be disabled. This could have some performance impact.
This issue affects OpenSSL versions 1.0.2.
OpenSSL 1.0.2 users should upgrade to 1.0.2f
This issue was reported to OpenSSL on 12 January 2016 by Antonio Sanso. The fix was developed by Matt Caswell of the OpenSSL development team (incorporating some work originally written by Stephen Henson of the OpenSSL core team).
Last updated 24 July 2024
If client authentication is used, then a server can crash with a segmentation fault in the event of a DHE ciphersuite being selected and a zero length ClientKeyExchange (CKE) message being sent by the client. This could be exploited in a denial of service attack.
This issue affects OpenSSL version 1.0.2, and is fixed in version 1.0.2a.
Acknowledgements:
Red Hat would like to thank the OpenSSL project for reporting this issue. Upstream acknowledges Matt Caswell of the OpenSSL development team as the original reporter.