summaryrefslogtreecommitdiff
path: root/src/lib/libc
diff options
context:
space:
mode:
authortb <>2022-03-15 15:54:26 +0000
committertb <>2022-03-15 15:54:26 +0000
commit72a7345922278c828af0637814fd3a28d28b4284 (patch)
tree07acfe5bf439f6734b6279e929dee64924ea98ff /src/lib/libc
parent2c0e7f8ac54f86297f1f41b51254e4b672dc9a6c (diff)
downloadopenbsd-OPENBSD_7_0.tar.gz
openbsd-OPENBSD_7_0.tar.bz2
openbsd-OPENBSD_7_0.zip
Fix infinite loop in BN_mod_sqrt()OPENBSD_7_0
A bug in the implementation of the Tonelli-Shanks algorithm can lead to an infinite loop. This loop can be hit in various ways, in particular on decompressing an elliptic curve public key via EC_POINT_oct2point() - to do this, one must solve y^2 = x^3 + ax + b for y, given x. If a certificate uses explicit encoding for elliptic curve parameters, this operation needs to be done during certificate verification, leading to a DoS. In particular, everything dealing with untrusted certificates is affected, notably TLS servers explicitly configured to request client certificates (httpd, smtpd, various VPN implementations, ...). Ordinary TLS servers do not consume untrusted certificates. The problem is that we cannot assume that x^3 + ax + b is actually a square on untrusted input and neither can we assume that the modulus p is a prime. Ensuring that p is a prime is too expensive (it would likely itself lead to a DoS). To avoid the infinite loop, fix the logic to be more resilient and explicitly limit the number of iterations that can be done. The bug is such that the infinite loop can also be hit for primes = 3 (mod 4) but fortunately that case is optimized earlier. It's also worth noting that there is a size bound on the field size enforced via OPENSSL_ECC_MAX_FIELD_BITS (= 661), which help mitigate further DoS vectors in presence of this fix. Reported by Tavis Ormandy and David Benjamin, Google Patch based on the fixes by David Benjamin and Tomas Mraz, OpenSSL ok beck inoguchi This is errata/7.0/016_bignum.patch.sig
Diffstat (limited to 'src/lib/libc')
0 files changed, 0 insertions, 0 deletions