blob: 87bc59694f1e7c05f0f0e67c72ba09bb38e3c8a0 [file] [log] [blame]
Manuel Pégourié-Gonnard43a1e732025-05-05 16:41:52 +02001Security
2 * Fix possible use-after-free or double-free in code calling
3 mbedtls_x509_string_to_names(). This was caused by the function calling
4 mbedtls_asn1_free_named_data_list() on its head argument, while the
5 documentation did no suggest it did, making it likely for callers relying
6 on the documented behaviour to still hold pointers to memory blocks after
7 they were free()d, resulting in high risk of use-after-free or double-free,
8 with consequences ranging up to arbitrary code execution.
9 In particular, the two sample programs x509/cert_write and x509/cert_req
10 were affected (use-after-free if the san string contains more than one DN).
11 Code that does not call mbedtls_string_to_names() directly is not affected.
12 Found by Linh Le and Ngan Nguyen from Calif.
13
14Changes
15 * The function mbedtls_x509_string_to_names() now requires its head argument
Manuel Pégourié-Gonnard38317282025-05-19 12:29:11 +020016 to point to NULL on entry. This makes it likely that existing risky uses of
Manuel Pégourié-Gonnard43a1e732025-05-05 16:41:52 +020017 this function (see the entry in the Security section) will be detected and
18 fixed.