-
Notifications
You must be signed in to change notification settings - Fork 20
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
Replace sanitizer with DOMPurify #52
Comments
I think he meant to use it in the pipeline on the vdom. I don't think that we need to apply it again on the HTL output. |
I agree to sanitize the output in the pipeline (see also my comment in adobe/helix-pipeline#263 (comment)). But I think we should still aim for reach maximum security in htlengine. Someone might use it independently and expect the output to be safe. |
I tested the performance with some larger files:
with dom purify:
with original sanitizer:
Given the fact, that we output a lot of HTML through the html context, I'm reluctant to use dompurify here. can we find the edge cases, where the current sanitizer doesn't work? |
I agree that performance is an important criterion. But in the one case where a customer gets hacked, it becomes moot :) After a quick test using the examples from a08b0e7, I wasn't able to break our current sanitizer. But I'm not an expert security researcher by any means, and my concern regarding the dead codebase and community remains. The next new attack vector might not be covered... |
So... how should we proceed with this issue :) If the majority thinks the current sanitizer is safe enough, I suggest we close this issue and the corresponding PR... |
I'd close it for now, but there is a slightly crazy idea I want to discuss with @tripodsan at the hackathon that could make it viable again (but this idea would break the rest of htlengine). |
:-) DOM based HTL engine ? |
DOM based everything! If we build HTLEngine the same way the JSX processor is built (by using |
xss_api.js currently uses Caja-HTML-Sanitizer for filterHTML(). As suggested by @lkrapf here, DOMPurify would be a more proven alternative with a very active community (while Caja-HTML-Sanitizer only has 48 commits and was last updated 3 years ago).
I propose to replace it with DOMPurify.
The text was updated successfully, but these errors were encountered: