HTTP security headers
Response headers such as CSP, HSTS, X-Content-Type-Options and Referrer-Policy that tell browsers to apply extra protections to your site.
Security headers are instructions the server sends with every response, and the browser enforces them. The core set: Content-Security-Policy limits which scripts may run, HSTS forces HTTPS, X-Content-Type-Options: nosniff stops the browser from guessing file types, Referrer-Policy limits how much of the URL leaks to other sites, frame-ancestors or X-Frame-Options blocks clickjacking, and Permissions-Policy turns off features such as camera access. OWASP’s HTTP Headers cheat sheet lists recommended values.
Scanners, assessors and a buyer’s security team can check them from outside in seconds, so gaps show up early in a review. Removing headers matters as well: a Server or X-Powered-By header that names the software and its version gives an attacker a head start. Headers limit what an attacker can do with a bug in the code; the bug itself still needs fixing, and a strict CSP takes real work to roll out.
Sources
- OWASP: HTTP Security Response Headers Cheat Sheet cheatsheetseries.owasp.org
Related terms
- CSP (Content Security Policy): An HTTP header that tells the browser which scripts, styles and connections a page may use, limiting the damage of injected code.
- HSTS (HTTP Strict Transport Security): A response header that tells browsers to reach your domain only over HTTPS for a set time, so nobody can downgrade the connection.
- Clickjacking: An attack that loads your site in an invisible frame on another page, so a user’s click lands on your button, such as “delete” or “pay”.
- CORS (cross-origin resource sharing): Headers that tell the browser which other websites may read responses from your API.
- XSS (cross-site scripting): Attacker-controlled script running in your page in another user’s browser, with that user’s session.
- OWASP ASVS (Application Security Verification Standard): An open checklist of security requirements for web apps and APIs, in three levels, used for design, testing and assessments such as CASA.
