Vulnsy
Web Application

HTTP Security Headers

HTTP security headers are a set of HTTP response headers that instruct web browsers to enable specific security mechanisms. They provide an essential layer of defence against common web attacks including XSS, clickjacking, MIME sniffing, and protocol downgrade attacks.

HTTP security headers are one of the most cost-effective security measures available to web application developers. They are configured on the server side and instruct browsers to enforce security policies that significantly reduce the attack surface. Implementing them typically requires minimal code changes and provides immediate protection for all users.

Key security headers include Content-Security-Policy (CSP), which controls resource loading to prevent XSS; Strict-Transport-Security (HSTS), which enforces HTTPS connections; X-Content-Type-Options with the nosniff value, which prevents MIME type sniffing; X-Frame-Options, which prevents clickjacking by controlling iframe embedding; Referrer-Policy, which controls how much referrer information is shared; and Permissions-Policy (formerly Feature-Policy), which controls browser feature access such as camera, microphone, and geolocation.

Newer headers like Cross-Origin-Opener-Policy (COOP), Cross-Origin-Embedder-Policy (COEP), and Cross-Origin-Resource-Policy (CORP) provide additional isolation between browsing contexts, mitigating speculative execution side-channel attacks like Spectre.

Implementing security headers should follow a phased approach: audit existing headers, deploy in report-only mode where available, monitor for issues, and then enforce. Regularly testing headers using tools like securityheaders.com and Mozilla Observatory ensures configurations remain effective as applications evolve. Headers should be set at the web server or CDN level for consistent application across all responses.

Related Terms

Related Vulnerabilities

http headershstscspbrowser security

Report Vulnerabilities Faster with Vulnsy

Stop rewriting the same findings. Use Vulnsy's reusable templates, collaborative workflows, and professional report generation to deliver pentest reports 10x faster.

Start Free Trial