Web Security · Senior · Question 11 of 75

What does the HTML Sanitizer API (setHTML) offer compared with a JavaScript sanitizer library?

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.

Further reading

Problem with a question

Web Security · Senior · question 11

Test yourself

Take the Web Security · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz