Web Security · Senior · Question 17 of 75

Why can XSS through postMessage happen even on a site with strict CSP?

Explanation

CSP blocks new scripts, not your own code doing something dangerous. Trusted Types catch string-to-sink flows like this.

Further reading

Problem with a question

Web Security · Senior · question 17

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