Web Security · Junior · Question 67 of 75

Why does adding 'unsafe-inline' to script-src weaken CSP so much?

Explanation

With 'unsafe-inline' an injected <script> or onerror handler runs again. Nonces or hashes allow your own inline code without opening that door.

Further reading

Problem with a question

Web Security · Junior · question 67

Test yourself

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

Take this quiz