mbedtls/ChangeLog.d/sni-parse-strict.txt
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

10 lines
593 B
Plaintext

Bugfix
* The TLS server now rejects a ClientHello whose server_name extension
is malformed: an empty server_name_list, a list that does not fill the
extension, an empty host_name, more than one host_name entry (forbidden
by RFC 6066), or an entry after the host_name that overruns the list.
Previously the first host_name was used and the rest of the extension
was not checked. These are rejected with a decode_error alert. A
host_name containing a null byte is rejected with an unrecognized_name
alert instead of being passed to the ServerName callback.