🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.HSTS
  2. B.Content-Security-Policy
  3. C.X-Content-Type-Options
  4. 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 →