Security Headers Grader
Check the quality of HSTS, CSP, browser policies and cookie flags. See exactly how each finding affects your grade and get configuration examples to review.
Transparent scoring
Our browser-page heuristic totals 100 points. Context-dependent choices can reduce a grade without establishing a vulnerability.
| Category | Maximum |
|---|---|
| csp | 25 |
| hsts | 20 |
| framing | 10 |
| nosniff | 10 |
| referrer | 5 |
| permissions | 5 |
| isolation | 6 |
| legacy | 4 |
| leakage | 5 |
| cookies | 10 |
CSP starts at 25: subtract 7 for missing or broad script restrictions, 4 each for unsafe-inline and unsafe-eval, 2 for wildcards, 3 each for missing object-src, base-uri and frame-ancestors, and 3 each for broad object-src or base-uri. Floor: zero. This is a lightweight heuristic; it does not fully parse CSP or model multiple policies, nonces, hashes or browser behavior.
HSTS: 15 for at least one year, 5 for a shorter positive lifetime, plus 5 for includeSubDomains with a positive lifetime; HTTP earns zero. Framing and nosniff: 10 each for recognized restrictions. Referrer: 5 for no-referrer, same-origin, strict-origin or strict-origin-when-cross-origin. Permissions: 5 for a recognized restricted allowlist.
Isolation: 2 each for recognized restrictive COOP, COEP and CORP. Legacy: start at 4, subtract 2 each for enabled X-XSS-Protection and Expect-CT. Leakage: 5 only when Server, X-Powered-By and X-AspNet-Version are absent. Cookies: 10 times the fraction with all inspected flags, rounded; no observed cookies earns 10.
Permissions allowlists, framing sources and cross-origin policies still need application-specific review. Header presence does not prove correct enforcement. Verify the rendered page and real user journeys after changing configuration.
Continue your checks
Check the rest of your website
Use the free vulnerability scanner for a broader passive check. Guests get 3 scans per day; registered users get 10.
Open the free vulnerability scannerFrequently asked questions
What does the letter grade measure?
Protego scores the observed response against a published heuristic for browser-facing HTML. It is not an OWASP certification, a penetration test or proof that a site is safe. APIs and public cross-origin resources can need different policies.
Does a preload directive mean a site is preloaded?
No. This tool checks header directives only. Preload eligibility also requires a valid certificate, an HTTP-to-HTTPS redirect on the same host and HTTPS on every subdomain. HTTPS redirects must also send HSTS. Check and submit the domain separately at hstspreload.org after a staged rollout.
Do I need both X-Frame-Options and frame-ancestors?
An enforced CSP frame-ancestors directive overrides X-Frame-Options in modern browsers. X-Frame-Options DENY or SAMEORIGIN can provide a fallback for older clients. Keep their intended embedding rules consistent.
Should X-XSS-Protection be enabled?
Current MDN and OWASP guidance favors an effective CSP. Remove X-XSS-Protection or use 0 to disable legacy filters, which can introduce vulnerabilities. Expect-CT is deprecated.
Can I paste every fix unchanged?
Treat snippets as starting points. Restrictive CSP, Permissions-Policy and cross-origin policies can break needed scripts, device features, popups or embeds. Test your own pages before deployment. Set cookie flags in the application that creates each cookie.
Which response and cookies are checked?
The server follows validated public redirects and checks the final response. HEAD is tried first, with GET fallback on failure. Bodies are discarded. Only cookies set on that unauthenticated response are inspected; values are omitted. This does not test login sessions or every page.
References
- OWASP Secure Headers Project: response headers
- OWASP Secure Headers: best practices
- MDN: Content-Security-Policy
- MDN: Set-Cookie
- MDN: Referrer-Policy
- MDN: Permissions-Policy
- MDN: Cross-Origin-Opener-Policy
- MDN: Cross-Origin-Embedder-Policy
- MDN: Cross-Origin-Resource-Policy
- MDN: X-XSS-Protection
- MDN: Expect-CT
- HSTS preload: requirements and rollout
- nginx add_header syntax
- Apache mod_headers syntax
- Next.js headers configuration
- Vercel headers configuration
Recommended: Sucuri
Website security platform: firewall, malware scanning, and DDoS protection.