CVE-2019-1551: rsaz_512_sqr overflow bug on x86_64
An overflow bug exists in the x86_64 Montgomery squaring routine used during exponentiation with 512-bit moduli. An attacker could potentially recover a DH512 private key, but only if the target re-uses that key, and other affected algorithms are considered very difficult to attack.
- Fixed in 4 days
- Disclosed after 34 days
There is an overflow bug in the x64_64 Montgomery squaring procedure used in exponentiation with 512-bit moduli. No EC algorithms are affected. Analysis suggests that attacks against 2-prime RSA1024, 3-prime RSA1536, and DSA1024 as a result of this defect would be very difficult to perform and are not believed likely. Attacks against DH512 are considered just feasible. However, for an attack the target would have to re-use the DH512 private key, which is not recommended anyway. Also applications directly using the low level API BN_mod_exp may be affected if they use BN_FLG_CONSTTIME.
OpenSSL versions 1.1.1 and 1.0.2 are affected by this issue. However due to the low severity of this issue we are not creating new releases at this time. The 1.1.1 mitigation for this issue can be found in commit 419102400. The 1.0.2 mitigation for this issue can be found in commit f1c5eea8a.
This issue was found by OSS-Fuzz and Guido Vranken and reported to OpenSSL on 12th September 2019. The fix was developed by Andy Polyakov with additional analysis by Bernd Edlinger.
Impact
Breaking DH512, according to the advisory.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely an integer overflow in the x86_64 Montgomery squaring procedure when handling 512-bit moduli during exponentiation.
Impact
Attacks against DH512 are considered just feasible, but only if the target re-uses the DH512 private key; attacks on 2-prime RSA1024, 3-prime RSA1536 and DSA1024 are believed very difficult and not likely.
What the attacker needed
Target re-uses a DH512 private key (for DH512 attack); or application uses BN_mod_exp with BN_FLG_CONSTTIME
The fix
The issue was mitigated in OpenSSL 1.1.1 and 1.0.2 via the referenced commits, though no new releases were made at the time due to low severity.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Some encryption maths relies on a routine that squares large numbers. That routine had a flaw that could leak information about a secret key. In practice the flaw is hard to exploit and mainly matters if a weak, reused key is in use.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.