should the Sanitizer API require a SecureContext?
Categories
(Core :: DOM: Security, enhancement, P3)
Tracking
()
People
(Reporter: freddy, Assigned: freddy)
References
(Blocks 1 open bug)
Details
(Whiteboard: [domsecurity-active])
Attachments
(1 external file)
I want to use this issue to discuss and formalize Mozilla's position on whether the Sanitizer API requires a secure context (See also the discussion within the spec group)
We've received feedback about pages that might want to make use of the API on pages that can not be considered a Secure Context. Specifically, consider a well-secured website that needs to support being in an iframe e.g., because it is serving a widget. Regardless of how well-secured that website is, once it is embedded in an iframe from an insecure HTTP web page, it will be unable to make use of the API.
I personally find it an interesting observation that websites who work hard for a good security posture might still be unable to make use of a helpful security API. Furthermore, I find it noteworthy that the Sanitizer API does not offer any new capabilities to the web platform. DOM creation or modification in itself is often times not subject to the "Secure Context for new APIs" restrictions and neither is new CSS syntax.
Therefore, I suggest that we at Mozilla decide not to require a Secure Context for the Sanitizer API.
Comment 1•4 years ago
•
|
||
I don't think it matters much, but it's not clear to me why this argument is valid given the decision around Web Crypto or origin-keyed agent clusters.
Updated•4 years ago
|
Comment 2•4 years ago
|
||
In part setHTML is a safer replacement for innerHTML. Like adding new css attributes universally, this should just be a basic part of a DOM element regardless of secure context.
| Assignee | ||
Comment 3•4 years ago
|
||
Comment 4•4 years ago
|
||
Looking at https://wiki.mozilla.org/DOM/WebIDL_Review_Checklist it cites https://blog.mozilla.org/security/2018/01/15/secure-contexts-everywhere/ which says discussion should happen on dev-platform. To quote myself from the review: In general this seems like the exact type of thing that should require SecureContext. Why enable a security-related API when you can't validate the integrity of the content using the security API?
Comment 5•1 year ago
|
||
The spec was changed to allow the Sanitizer API in insecure context as well.
Description
•