mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
domainToASCII() is implemented with the URL host parser, which stops at path, query and fragment delimiters and percent-decodes. Passing a hostname through it can therefore silently shorten the name, so checkServerIdentity() validates a certificate against a host the application never asked for: name resolution and SNI use the original string, while the certificate is matched after normalization. Reject hostnames containing a WHATWG forbidden host code point before matching. None of these code points is valid in a DNS hostname, so failing closed is safe. Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: https://github.com/nodejs/node/pull/67254 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>