HTTP security headers are instructions a website sends to the browser that switch on built-in protections against attacks such as cross-site scripting, clickjacking and protocol downgrades. They cost nothing to add, and a few lines in your server or CDN config can raise a site from an F to an A.
Headers we grade
| Header | Protects against | Weight |
|---|---|---|
| Content-Security-Policy | Cross-site scripting (XSS) and injected scripts | 25 |
| Strict-Transport-Security | HTTPS downgrade and cookie theft on public Wi-Fi | 20 |
| frame-ancestors / X-Frame-Options | Clickjacking through hidden frames | 15 |
| X-Content-Type-Options | MIME-type sniffing attacks | 10 |
| Referrer-Policy | Leaking full URLs to other sites | 10 |
| Permissions-Policy | Unwanted access to camera, mic and location | 10 |
| Cross-Origin-Opener-Policy | Cross-window attacks from pop-ups | 5 |
The grade is A at 90 or more, B at 75, C at 60 and D at 40. A site served only over plain HTTP is capped at 30, because none of these headers can be trusted without HTTPS.
We also flag headers that reveal software versions, such as X-Powered-By: PHP/7.4.3, and list cookie flags (Secure, HttpOnly, SameSite).
A good starting set
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Security-Policy: default-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self'
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()
Content-Security-Policy is the one most likely to break things, because it blocks scripts and styles from sources you have not listed. Send it as Content-Security-Policy-Report-Only first, fix what it reports, then enforce it.
Where to add headers
- Nginx:
add_header Name "value" always;in the server block. - Apache:
Header always set Name "value"with mod_headers on. - Cloudflare: Rules → Transform Rules → Modify Response Header.
- Netlify and Cloudflare Pages: a
_headersfile in the site root. - WordPress: your host's panel or a security plugin that sets headers.
How the scan works
Our server makes one normal GET request to the address you enter and follows up to 6 redirects, the same way a browser does. It reads only the response headers. It does not crawl, probe or test for vulnerabilities.
A strong header set works best on a site with valid HTTPS. Confirm your certificate with the SSL certificate checker.
Frequently asked questions
Which security header is most important?
Content-Security-Policy gives the most protection, and Strict-Transport-Security is the easiest high-value win. Start with HSTS, nosniff and frame-ancestors, then build a CSP.
Is X-XSS-Protection still needed?
No. Modern browsers removed the XSS auditor it controlled. Use a Content-Security-Policy instead.
Will adding headers break my site?
Most will not. A strict Content-Security-Policy can, so test it in report-only mode first. HSTS can lock out visitors if parts of the site do not work over HTTPS.
Why does my grade differ from other scanners?
Each scanner weights headers differently. Focus on the specific findings rather than the letter.