Web Security · Senior · Question 11 of 75
What does the HTML Sanitizer API (setHTML) offer compared with a JavaScript sanitizer library?
- 1It allows
<script>tags as long as they are small - ✓Correct answer: Sanitization built into the browser, using the same parser that will render the HTML
- 3It encrypts the HTML so only the server can read it
Explanation
Using the browser's parser avoids parser differences behind mXSS. Until it's available in all target browsers, libraries like DOMPurify are still needed.