Security Headers Analyzer
Paste response headers from curl or DevTools and grade HSTS, CSP, nosniff, framing, Referrer-Policy and cross-origin policies, with notes on what to fix.
The interactive tool loads here when JavaScript runs.
About this toolWhat is Security Headers Analyzer?
The Security Headers Analyzer grades the HTTP response headers that browsers use as security controls: Strict-Transport-Security, Content-Security-Policy, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy and the three cross-origin policies (COOP, CORP, COEP). Each header is marked Good, Weak, Missing or Info, with a one-line reason such as "max-age is under six months" or "unsafe-inline allows injected inline scripts".
You supply the headers by pasting them. The URL field builds a curl -sSIL command for you; run it and paste the output, or copy the raw response headers from the Network tab in DevTools. A page cannot fetch these headers itself, because CORS hides almost every response header of another origin from JavaScript. The analysis runs in your browser.
When curl follows redirects it prints several responses. The analyzer uses the last block, which is the page you actually land on. It also lists headers that leak software versions, such as Server: nginx/1.25.3 or X-Powered-By.
- Grades ten security headers with a reason for each result
- Parses curl -I output, including redirect chains, and DevTools raw headers
- CSP checks for unsafe-inline, unsafe-eval, wildcards and object-src
- Accepts CSP frame-ancestors in place of X-Frame-Options
- Flags Server and X-Powered-By version disclosure; runs locally
Updated
How to use Security Headers Analyzer
- Enter the page URL and click Copy curl Command, or open DevTools, select the document request in the Network tab and copy the raw Response Headers.
- Run the command and paste its output into the headers box. Status lines and other responses in a redirect chain are handled for you.
- Click Analyze Headers.
- Work through the Weak and Missing cards first; each one shows the value received and why it was graded that way.
- Check the Information Disclosure card for Server or X-Powered-By headers that reveal versions.
Worked example
The sample response
Input
strict-transport-security: max-age=31536000; includeSubDomains content-security-policy: default-src 'self'; script-src 'self' 'unsafe-inline'; img-src 'self' data: referrer-policy: no-referrer-when-downgrade
Output
3 Good, 2 Weak, 4 Missing, 0 Critical Missing
HSTS, nosniff and SAMEORIGIN framing pass. The CSP is Weak because of unsafe-inline and because object-src is not set to none. The Referrer-Policy leaks full URLs to other HTTPS sites. Permissions-Policy and the three cross-origin headers are absent, and X-Powered-By: Express plus a versioned Server header appear under disclosure.
Background and insight
Most of these headers exist because the browser cannot otherwise know the site's intent. HSTS (RFC 6797) tells it to refuse plain HTTP for a period, closing the gap that SSL-stripping attacks used. CSP limits where scripts may come from, so an injected script tag fails to run even if an XSS bug slips through. X-Content-Type-Options: nosniff stops the browser from deciding that an uploaded text file is really JavaScript.
Some advice online is out of date. X-XSS-Protection controlled an XSS auditor that Chrome removed in 2019 and other browsers have dropped; OWASP now recommends sending 0 or nothing, so the analyzer reports it as informational rather than missing. X-Frame-Options still works, but CSP frame-ancestors supersedes it, and the analyzer accepts either. ALLOW-FROM was never widely supported and is ignored by current browsers.
A CSP that contains 'unsafe-inline' for scripts gives up most of its XSS protection, which is why the analyzer marks it Weak unless a nonce or hash is also present (browsers that support nonces then ignore unsafe-inline). Content-Security-Policy-Report-Only on its own reports violations but blocks nothing.
Common use cases
Pre-launch review
Check a staging site's headers before go-live, when changing a reverse proxy or CDN rule is still cheap.
Answering a pentest or questionnaire finding
Confirm which headers are really missing and get the specific reason a value was flagged.
Comparing environments
Paste headers from production and staging in turn to spot a proxy that strips or overrides them.
Tightening a CSP
See whether unsafe-inline, unsafe-eval or wildcard script sources are still present after a refactor.
Tips and limitations
- curl -I sends a HEAD request. A few servers and frameworks set headers only on GET; if results look sparse, compare with DevTools.
- HSTS with a max-age under six months is graded Weak. One year (31536000) is the usual target, and preload lists require includeSubDomains and preload as well.
- Headers set by a CDN can differ per path. Check an HTML page, not just the home page or a static asset.
- Missing COOP, CORP or COEP is not critical for most sites; they matter when you need cross-origin isolation or want to stop other sites embedding your resources.
- Fixing a header is usually one line in nginx, Apache, your CDN rules or framework middleware. Test with Report-Only before enforcing a new CSP.
Sources and further reading
- RFC 6797: HTTP Strict Transport Security (HSTS), IETF
- HTTP Headers Cheat Sheet, OWASP. Recommended values, including the advice on X-XSS-Protection
- Content-Security-Policy (CSP) header, MDN Web Docs. Directives, nonces, hashes and frame-ancestors
- X-XSS-Protection header, MDN Web Docs. Why the header is deprecated and what replaced it
Frequently asked questions
Why do I have to paste headers instead of entering a URL?
A web page cannot read most response headers from another site because of CORS, so a browser-only tool has no honest way to fetch them. Run the curl command the tool generates or copy the raw headers from DevTools, and the analysis then runs locally on exactly what the server sent.
Is X-XSS-Protection still needed?
No. It controlled the XSS auditor that Chrome removed in 2019 and other browsers no longer ship. OWASP recommends either omitting it or sending X-XSS-Protection: 0, and the analyzer reports it as informational. Content-Security-Policy is the header that protects against XSS today.
What HSTS max-age should I use?
Use at least six months (15768000 seconds), and one year (31536000) for most production sites. Start lower while testing, because browsers remember the policy for the full max-age. The HSTS preload list additionally requires includeSubDomains and the preload directive.
Why is my Content-Security-Policy marked Weak?
The usual reasons are 'unsafe-inline' or 'unsafe-eval' in script-src (or default-src), a wildcard or bare https: script source, or object-src not set to none. The card for CSP lists exactly which of these the analyzer found in the value you pasted.
Do I need both X-Frame-Options and CSP frame-ancestors?
One is enough for current browsers, and frame-ancestors is the newer, more flexible option. Many sites send both so older clients are covered. If your CSP has frame-ancestors and no X-Frame-Options header, the analyzer counts framing protection as present.
Is it a problem that my Server header shows a version number?
It is a small information leak rather than a vulnerability. A version string tells scanners exactly which known bugs to try, so hiding it (server_tokens off in nginx, removing X-Powered-By in Express) is cheap hygiene. A bare product name like nginx is not flagged.
Is there an in-depth guide to Security Headers Analyzer?
Yes. “HTTP Security Headers: What to Send and What to Skip” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.