HTTP Security Headers: A Practical Hardening Guide
Configure CSP, HSTS, X-Content-Type-Options, Referrer-Policy, frame-ancestors and Permissions-Policy correctly, with real Nginx and CloudFront snippets.
- A strong Content-Security-Policy is the single biggest defense against XSS (A03:2021, CWE-79).
- HSTS forces HTTPS and blocks SSL-stripping downgrade attacks after the first visit.
- X-Content-Type-Options: nosniff stops browsers from re-interpreting uploads as executable content.
- frame-ancestors replaces X-Frame-Options to kill clickjacking (CWE-1021).
- Headers are a defense-in-depth layer, not a substitute for fixing the underlying bug.
Guard what you build. Prove what you guard. This app needs JavaScript to run an audit; please enable it.