-
Notifications
You must be signed in to change notification settings - Fork 31
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
Consider handling of javascript: urls in navigation #70
Comments
Ugh. Do we have to classify attributes according to their content (URLs for navigations, URLs for subresources, text, booleans)? The table at https://html.spec.whatwg.org/multipage/indices.html#attributes-3 is doing that, but it's a non-normative table, so there might be a risk of classifying attributes incorrectly when not reading all of the individual definition texts. |
scratch that. @annevk tells me the table is non-normative because there's no real system of "types" that would be granular enough or even really well-exposed.. So, we have to do this by element + attribute name |
Trusted Types proposes a normative annotation for attributes that matter for XSS, though not URLs, we just added guards on navigation. In that sense, |
I've been explaining Sanitizer API to everyone as making security easier to use. So for Sanitizer - at least for Sanitizer v1 - my intent is have an easy-to-use and easy-to-explain config, and then handle whatever doesn't fit into that config as special cases in the specification. So far, I understand that special casing stuff is inelegant, but prematurely generalizing the spec also has its costs. If we find more such cases, or find such a mechanism generally useful, I think we can try to generalize the mechanism post-v1. (See also, #26) I guess an alternative would be to use CSP to forbid |
|
I don't think we can depend the Sanitizer on anything that's defined in TrustedTypes. |
To clarify, I'm just saying that TT had a similar problem to solve, and we decided to do it via WebIDL extended attribute. Similar problems might benefit from a similar solution, and the IDL bit in specific is just a primitive we use to build TT guards on top of. I don't propose to introduce dependency on TT guard logic, policies etc. |
javascript:-URLs are apparently executed only during navigation. And navigate-y element/attributes are
Surely there are more? |
|
Yes, thank you. Also, my friendly colleagues pointed me to this list of navigate-y things: https://github.com/WICG/app-history#appendix-types-of-navigations |
iframe + embed + object are blocked anyhow. I'm unsure what to with base, since base doesn't directly navigate. I've added a, area, form, and input to #63 as special cases. |
Consider how to handle javascript: urls, e.g. in
<a href="...">
. Likely, these should be dropped unconditionally.The text was updated successfully, but these errors were encountered: