Web Security
Check HTTP security headers (CSP, HSTS, X-Frame-Options, X-XSS-Protection, Referrer-Policy, and more) with security scoring.
Security headers are HTTP response headers that instruct browsers how to behave when handling a website's content. They provide critical defense-in-depth against common web attacks including Cross-Site Scripting (XSS), clickjacking, MIME sniffing, man-in-the-middle attacks, and data injection. When a browser receives these headers, it enforces security policies that the application alone cannot guarantee, making them an essential layer of web application security.
For security professionals, checking security headers is one of the first steps in assessing a web application's security posture. Missing or misconfigured headers indicate that the application lacks fundamental browser-enforced protections. A site without Content-Security-Policy is vulnerable to XSS, a site without Strict-Transport-Security allows SSL stripping, and a site without X-Frame-Options can be framed by attacker-controlled pages.
Security headers are also a common finding in penetration test reports and compliance audits. Standards like OWASP Top 10, PCI DSS, and SOC 2 reference security headers as indicators of secure web configuration. This tool checks for all major security headers, scores their configuration, and provides actionable guidance for improvement.
Content-Security-Policy (CSP) is the most important security header. It defines which sources of content (scripts, styles, images, frames) a browser is allowed to load, effectively preventing XSS attacks by blocking inline scripts and unauthorized external resources. A well-crafted CSP is the single most effective browser-side defense against script injection attacks.
Strict-Transport-Security (HSTS) forces browsers to communicate with the site only over HTTPS, preventing SSL stripping attacks where an attacker downgrades the connection to HTTP. HSTS also protects against cookie hijacking by ensuring all traffic is encrypted. The includeSubDomains directive extends protection to all subdomains, and the preload directive allows inclusion in browser HSTS preload lists.
X-Frame-Options (XFO) and X-Content-Type-Options protect against clickjacking and MIME sniffing attacks respectively. XFO prevents a page from being embedded in an iframe on another site, stopping attackers from overlaying invisible iframes to trick users into clicking unintended elements. X-Content-Type-Options with nosniff prevents browsers from interpreting files as a different MIME type than declared.
Deploying security headers correctly requires understanding your application's content sources and legitimate embedding needs. A CSP that is too strict breaks functionality, while one that is too permissive provides no protection. Start with a report-only CSP to identify what your application loads, then tighten the policy incrementally. Use nonces or hashes for inline scripts rather than disabling CSP's inline protection.
HSTS should be enabled gradually. Start with a short max-age (one hour) while testing, then increase to six months or one year. Once you are confident that HTTPS works correctly across all subdomains, enable includeSubDomains and consider submitting to the HSTS preload list for maximum protection.
Headers should be applied consistently across all responses, including error pages, API endpoints, and static assets. Inconsistent header deployment creates gaps that attackers can exploit. Regular header audits using automated tools ensure that new pages and endpoints inherit the correct security configuration.