mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-03-06 04:23:01 +00:00
Merge fix IOTSSL-475 Potential buffer overflow
Two possible integer overflows (during << 2 or addition in BITS_TO_LIMB()) could result in far too few memory to be allocated, then overflowing the buffer in the subsequent for loop. Both integer overflows happen when slen is close to or greater than SIZE_T_MAX >> 2 (ie 2^30 on a 32 bit system). Note: one could also avoid those overflows by changing BITS_TO_LIMB(s << 2) to CHARS_TO_LIMB(s >> 1) but the solution implemented looks more robust with respect to future code changes.
This commit is contained in:
@@ -11,6 +11,11 @@ Security
|
||||
* Fix stack buffer overflow in pkcs12 decryption (used by
|
||||
mbedtls_pk_parse_key(file)() when the password is > 129 bytes.
|
||||
Found by Guido Vranken. Not triggerable remotely.
|
||||
* Fix potential buffer overflow in mbedtls_mpi_read_string().
|
||||
Found by Guido Vranken. Not exploitable remotely in the context of TLS,
|
||||
but might be in other uses. On 32 bit machines, requires reading a string
|
||||
of close to or larger than 1GB to exploit; on 64 bit machines, would require
|
||||
reading a string of close to or larger than 2^62 bytes.
|
||||
|
||||
Changes
|
||||
* Added checking of hostname length in mbedtls_ssl_set_hostname() to ensure
|
||||
|
||||
Reference in New Issue
Block a user