Problem Statement
Which security header specifically helps mitigate reflected and stored cross-site scripting in modern browsers?
Explanation
Content-Security-Policy lets you whitelist trusted script sources and block inline or dynamic code execution paths. It dramatically reduces XSS risk when deployed with care and good testing. HSTS enforces HTTPS, X-Frame-Options prevents clickjacking, and Referrer-Policy limits sensitive referrer data.
Code Solution
SolutionRead Only
Example: Content-Security-Policy: default-src 'self'; script-src 'self' https://cdn.example.com
