Do not remove %s token when validating (un)registerProtocolHandler's URL
The HTML specifications [1] indicates that the "%s" token is preserved when parsing the URL and this is important to properly perform syntax validation. Currently, Chrome removes the token, which means that something like "ht%stp://example.org" is treated as a valid URL and bypasses the security check. This is however treated as invalid for the browser process validation and so leads to a crash (bad IPC message). The WPT tests are updated to provide the correct expectations. Those for which the %s token is inside the protocol are treated as relative URLs and are valid. Others where the %s token is inside the hostname or port should raise syntax errors. [1] https://html.spec.whatwg.org/multipage/system-state.html#normalize-protocol-handler-parameters Bug: 1112377 Change-Id: I962bcfdd593223568fc72475efeb299adaa72236 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335434Reviewed-by:Mike West <mkwst@chromium.org> Commit-Queue: Frédéric Wang <fwang@igalia.com> Cr-Commit-Position: refs/heads/master@{#796404}
Showing
Please register or sign in to comment