-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Percent encode NULLs in fragments #440
Comments
Okay, so this is specifically about removing the U+0000 branch from https://url.spec.whatwg.org/#fragment-state. This was last changed five years ago in https://www.w3.org/Bugs/Public/show_bug.cgi?id=27252 but no tests were added specifically for U+0000. |
That seems reasonable to me, especially since Safari and Firefox are shipping. Perhaps @ericlaw1979 knows who to redirect this to for IE/Edge for any compat concerns? |
I agree with @sleevi. |
IE/Spartan are extremely unlikely to change this. Vis-a-vis Chrome, I'm not sure what "special URLs" include, but would this change the behavior of URLs passed out to application protocol handlers? AppProtocols tend to be the easiest routes out of the browser sandbox, and the native-code full-trust applications parsing the URLs handed to them do so with varying levels of paranoia. |
@ericlaw1979 So-called special schemes are just |
I'm pretty sure that Chrome, at least, hands everything in the URL to the app (the "non-special" case in the table above). If apps are vulnerable to some aspect of parsing nulls, they're already in trouble. This wouldn't add much trouble, I think.
#342 :) |
See whatwg/url#440 for context.
See whatwg/url#440 and whatwg/url#486 for context.
…a=testonly Automatic update from web-platform-tests URL: percent encode NULLs in fragments See whatwg/url#440 and whatwg/url#486 for context. -- wpt-commits: efec8204e84d434d80407bb7cf8df37d33cabaa1 wpt-pr: 23256
…a=testonly Automatic update from web-platform-tests URL: percent encode NULLs in fragments See whatwg/url#440 and whatwg/url#486 for context. -- wpt-commits: efec8204e84d434d80407bb7cf8df37d33cabaa1 wpt-pr: 23256
…a=testonly Automatic update from web-platform-tests URL: percent encode NULLs in fragments See whatwg/url#440 and whatwg/url#486 for context. -- wpt-commits: efec8204e84d434d80407bb7cf8df37d33cabaa1 wpt-pr: 23256
…a=testonly Automatic update from web-platform-tests URL: percent encode NULLs in fragments See whatwg/url#440 and whatwg/url#486 for context. -- wpt-commits: efec8204e84d434d80407bb7cf8df37d33cabaa1 wpt-pr: 23256
…a=testonly Automatic update from web-platform-tests URL: percent encode NULLs in fragments See whatwg/url#440 and whatwg/url#486 for context. -- wpt-commits: efec8204e84d434d80407bb7cf8df37d33cabaa1 wpt-pr: 23256 UltraBlame original commit: 650ec6f46c2e17f43b3448bd91f3616e1622e3d9
…a=testonly Automatic update from web-platform-tests URL: percent encode NULLs in fragments See whatwg/url#440 and whatwg/url#486 for context. -- wpt-commits: efec8204e84d434d80407bb7cf8df37d33cabaa1 wpt-pr: 23256 UltraBlame original commit: daaf57708f9447f0f68e4caadb80eac9ce03c477
…a=testonly Automatic update from web-platform-tests URL: percent encode NULLs in fragments See whatwg/url#440 and whatwg/url#486 for context. -- wpt-commits: efec8204e84d434d80407bb7cf8df37d33cabaa1 wpt-pr: 23256 UltraBlame original commit: 650ec6f46c2e17f43b3448bd91f3616e1622e3d9
…a=testonly Automatic update from web-platform-tests URL: percent encode NULLs in fragments See whatwg/url#440 and whatwg/url#486 for context. -- wpt-commits: efec8204e84d434d80407bb7cf8df37d33cabaa1 wpt-pr: 23256 UltraBlame original commit: daaf57708f9447f0f68e4caadb80eac9ce03c477
…a=testonly Automatic update from web-platform-tests URL: percent encode NULLs in fragments See whatwg/url#440 and whatwg/url#486 for context. -- wpt-commits: efec8204e84d434d80407bb7cf8df37d33cabaa1 wpt-pr: 23256 UltraBlame original commit: 650ec6f46c2e17f43b3448bd91f3616e1622e3d9
…a=testonly Automatic update from web-platform-tests URL: percent encode NULLs in fragments See whatwg/url#440 and whatwg/url#486 for context. -- wpt-commits: efec8204e84d434d80407bb7cf8df37d33cabaa1 wpt-pr: 23256 UltraBlame original commit: daaf57708f9447f0f68e4caadb80eac9ce03c477
Currently URL parser removes NULL characters from fragments. But is this really needed?
My tests show that NULLs are percent encoded in most browsers (I tested URLs "
https://example.com/#abc\u0000xyz
" and "non-spec://example.com/#abc\u0000xyz
"):#abcxyz
#abc%00xyz
#abc
#abc
#abc%00xyz
#abc%00xyz
#abc%00xyz
#abc%00xyz
So NULLs are removed in Chrome in special URLs only. In the Edge and IE a NULL character
denotes the end of string.
One reason, why Chrome removes NULLs, I found in the source code:
https://chromium.googlesource.com/chromium/src/+/refs/tags/76.0.3803.1/url/url_canon_etc.cc#304
But as we see NULLs in Chrome and IE (and Edge) are handled differently.
I suggest to follow Firefox, Safari and percent encode NULLs in fragments.
The text was updated successfully, but these errors were encountered: