Skip to tool
OWASP Web Defense & Header Audit

Security Headers Checker

Inspect, test, and harden your HTTP response headers. Audit Content-Security-Policy (CSP), Strict-Transport-Security (HSTS), X-Frame-Options, Cookie security flags, and generate ready-to-deploy configuration snippets.

  • Instant letter grading (A+ to F) & OWASP Top 10 defense evaluation
  • Audit CSP directives, HSTS Preload eligibility, XFO, & Referrer-Policy
  • Copy-paste configuration snippets for Nginx, Apache, Cloudflare, Next.js, & Caddy

Knowledge base

Understand the signal behind the score

Practical context to help you turn the output into faster, more reliable experiences.

Content-Security-Policy (CSP): Stopping XSS at the Root

Cross-Site Scripting (XSS) remains one of the top OWASP web security vulnerabilities. Even with input sanitization and template escaping, a single unescaped variable can compromise your entire user base.

Content-Security-Policy (CSP) restricts which domains can execute scripts, fetch resources, or open WebSockets. By specifying object-src 'none', base-uri 'self', and utilizing cryptographic nonces or hashes instead of 'unsafe-inline', malicious scripts injected via user comments or third-party widgets are halted immediately by the browser engine.

HSTS & Preloading: Eliminating SSL-Stripping Attacks

When a user types example.com into their browser address bar, the initial request is often sent over unencrypted HTTP before being redirected to HTTPS. During this brief window, attackers on public Wi-Fi or compromised routers can intercept the request using tools like SSLstrip to prevent the upgrade.

HTTP Strict Transport Security (HSTS) forces browsers to communicate exclusively over HTTPS for a defined duration (e.g. max-age=31536000). When combined with includeSubDomains and registered on the HSTS Preload list, modern browsers hardcode the HTTPS requirement directly into browser binaries, eliminating the initial unencrypted roundtrip forever.

Defeating Clickjacking: Framing Protections & MIME Sniffing

In a Clickjacking attack, an adversary embeds your authenticated website inside a transparent <iframe>on an attacker-controlled page, tricking users into clicking invisible buttons (such as “Authorize Transfer” or “Delete Account”).

Setting X-Frame-Options: SAMEORIGIN or modern CSP frame-ancestors 'self' instructs the browser to forbid rendering inside external frames. Furthermore, pairing this with X-Content-Type-Options: nosniff prevents browsers from MIME-sniffing uploaded files and interpreting user avatars as executable HTML or script files.

Cookie Hardening: Secure, HttpOnly, and Prefix Conventions

Cookies are the cornerstone of web session management. Without explicit security attributes, cookies can be intercepted over non-TLS networks, stolen via JavaScript document.cookie in XSS attacks, or submitted automatically in Cross-Site Request Forgery (CSRF) exploits.

Always set Secure (HTTPS-only transmission), HttpOnly (inaccessible to script APIs), and SameSite=Lax or SameSite=Strict. For authentication tokens, adopting __Host- prefixes provides cryptographic domain binding that cannot be overwritten by insecure subdomains.

Frequently Asked Questions