From cceb4356cca233b6dfdaabd888263157b2204e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rimas=20Misevi=C4=8Dius?= Date: Thu, 7 May 2020 07:03:17 +0300 Subject: [PATCH] Verify domain is not empty after Unicode ToASCII The empty host is not allowed in special non-"file" URLs, but Unicode ToASCII can result in the empty string, even if the input is not empty, for example: * the input consists entirely of IDNA ignored code points * the input is `xn--`. Domain to ASCII (which invokes Unicode ToASCII) does not fail when it is called from the host parser with such an input, because VerifyDnsLength is false. So it needs an additional check. Tests: https://github.com/web-platform-tests/wpt/pull/23432. --- url.bs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/url.bs b/url.bs index dd42d7b6..d60dc3ef 100644 --- a/url.bs +++ b/url.bs @@ -397,6 +397,8 @@ decisions made, i.e. whether to use the same site or schemelessly same
  • If result is a failure value, validation error, return failure. +

  • If result is the empty string, validation error, return failure. +

  • Return result.