Joachim Bauernberger 8134d60565 Reject malformed server_name extensions in ClientHello
mbedtls_ssl_parse_server_name_ext() used the first host_name entry and
returned without looking at the rest of the extension. It accepted an
empty server_name_list, a list that does not fill the extension, an
empty host_name, a second host_name entry (forbidden by RFC 6066,
section 3) and a malformed entry following the host_name, and it passed
host names containing a null byte to the ServerName callback.

Validate the whole list first, then record the host name and call the
ServerName callback. Structural errors are rejected with a decode_error
alert, a null byte in the host name with an unrecognized_name alert.
Entries of unknown name types are still skipped, as RFC 6066 allows.

Signed-off-by: Joachim Bauernberger <joachim.bauernberger@protonmail.com>
2026-10-25 16:32:22 +01:00
..
mbedtls Reject malformed server_name extensions in ClientHello 2026-10-25 16:32:22 +01:00
.gitignore Rename include directory to mbedtls 2015-03-10 11:23:56 +00:00
CMakeLists.txt CMake: make generated configs relocatable 2026-08-14 16:20:27 +01:00