← Quiz: XSS: all 10 questions
Quiz: XSS · Question 5 of 10
Which header acts as a safety net that blocks inline scripts if an XSS bug slips through?
Which header acts as a safety net that blocks inline scripts if an XSS bug slips through?
- A.HSTS
- B.Content-Security-Policy
- C.X-Content-Type-Options
- D.Referrer-Policy
Answer & explanation
Correct answer: Content-Security-Policy
A CSP like script-src 'self' blocks inline scripts and event handlers such as onerror.
Can you get the rest right without peeking?
Take the timed Quiz: XSS quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →