Primary eng (and PM) emails
Summary
`<base href="data:/,-alert(1)/">` causes `<script href="whatever">` to resolve to `data:/,-alert(1)/whatever`, which executes code before dying with an error. This doesn't make much sense, and (apparently) has zero non-malicious uses.
I'd like to remove the ambiguity between URL resolution (`data:` scheme with a path of `/,-alert(1)/`) and resource parsing (MIME type of `/` and a body of `-alert(1)/whatever`) by ignoring `data:` URLs in `<base href>`.
Motivation
https://bugs.chromium.org/p/chromium/issues/detail?id=689412 (as well as the earlier discussion at http://sebastian-lekies.de/csp/bypasses.php) use this mechanism to bypass CSP nonces. Restricting `data:` won't prevent this kind of attack (as attackers could certainly inject `<base href="https://evil.com/">` instead), but it does seem to be a pretty sane change that removes some surprising behavior.
Compatibility And Interoperability Risk
Based on quick experimentation with https://output.jsbin.com/zucihoraca:* Safari matches Chrome's behavior.
* Edge ignores `data:` inside `<base>` (it tries to request the original resource)
* Firefox allows `data:` URLs in `<base>`, but doesn't request the resulting resource. I haven't dug into the details.
I've filed https://github.com/whatwg/html/issues/2249, and the reaction from Anne is ambivalent. IMO, aligning with Edge makes the most sense. *shrug*
Alternative implementation suggestion for web developers
Developers can use `https:` URLs in `<base>`. Or, you know, just not use `<base>`.
Usage information from UseCounter
`UseCounter::BaseWithDataHref` shows zero usage in the last week across Canary, Dev, and Beta channels.
OWP launch tracking bug
Entry on the feature dashboard
Given the literally null usage, adding a feature entry seems like noise, but I'm happy to do so if folks disagree.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
LGTM3