Angular · Senior · Question 34 of 75

When is DomSanitizer.bypassSecurityTrustHtml() dangerous?

Explanation

Bypass only for content you fully control, or sanitize it yourself first with a trusted library. Enable Trusted Types and a strict CSP for defense in depth.

Further reading

Problem with a question

Angular · Senior · question 34

Test yourself

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

Take this quiz