State and browser security
Browser security headers
Add response headers that constrain scripts, framing, MIME sniffing, referrer data, and future connections made by the browser.
9 minute lesson
~~~
Security headers tell a browser which capabilities to allow.
Content-Security-Policyrestricts where scripts, styles, images, and other resources may load from.X-Content-Type-Options: nosnifftells the browser to respect declared content types.Referrer-Policylimits referrer information sent to other sites.Permissions-Policycontrols selected browser features.frame-ancestorsinside CSP controls which pages may embed yours.
A strict policy can break an existing site, so deploy carefully. Start by inventorying required sources. CSP can run in report-only mode while you observe violations.
Headers reduce risk but do not repair unsafe application code. You still need output escaping, input validation, secure authentication, and current dependencies.
Quick check
Result
You got of right.
Lesson completed