Check a site's security headers: paste the response headers
Paste the response headers of a page, as DevTools or curl -I shows them. The checker gives each security header (Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, the Cross-Origin policies, cookies and CORS) a verdict and a plain reason. Then it does what a scanner cannot: it turns the suggested headers into a HeaderDial profile, so you can try the fix in your browser before you deploy it. The text is read in this page: nothing you paste is sent anywhere, and the page makes no network requests after it has loaded (no CDN, no web fonts, no analytics).
Read locally. Nothing you paste leaves this tab.
| Header | Verdict | Why |
|---|
Try the fix in your browser before you deploy it
Ticked rows become response headers in a HeaderDial profile (each one set, replacing what the server sends). Rows for headers that already look fine start unticked. Edit any value first.
| Use | Header | Value |
|---|
Permissions-Policy and an 'unsafe-inline' script policy are not worth the same, and only you know which pages need what. The count above the table is just a tally.Copy the response headers
- Chrome and Edge: open DevTools (F12), Network panel, reload, and click the first request (the document). In Headers, under Response Headers, switch on Raw and copy the block. Selecting the normal (non-raw) list works too: that copy puts each name and its value on separate lines, and the checker pairs them up. If your selection also covers the General section, the Request URL in it gives the host for the Domain filter, and anything under Request Headers is ignored.
- Firefox: Network panel, select the request, Headers tab, turn on the Raw switch next to Response Headers and copy. The JSON that the panel's Copy All context menu item produces is also accepted; only its response part is read.
- curl:
curl -sI https://www.example.com/sends a HEAD request;curl -s -D - -o /dev/null https://www.example.com/sends a real GET (some servers answer HEAD differently). Add-Lto follow redirects: every hop is printed, and the checker reads the last response. Paste the command line too and the checker takes the host from it.curl -voutput works as well.
Check the HTML page itself, not an image or a script: headers like CSP and X-Frame-Options only matter on documents, so on other responses they show as not applicable. Check more than the home page, too. Login pages, the API and static files often come from different servers with different headers.
How each header is checked
Content-Security-Policy
A CSP tells the browser where scripts, styles, frames and other resources may come from, so an injected <script> (cross-site scripting) does not run. The checker looks at the source list that governs scripts: script-src, or default-src when there is no script-src.
- Missing on an HTML page: nothing limits scripts.
- Weak when scripts are allowed with
'unsafe-inline'and the list has no nonce ('nonce-…') or hash ('sha256-…'). A nonce or hash makes current browsers ignore'unsafe-inline', so the pair is a normal fallback for old browsers, not a problem. - Weak with
'unsafe-eval'(lets strings become code througheval()), with*,https:,data:orblob:as script sources (any host), and with noobject-srcand nodefault-src(plugins are not limited;object-src 'none'is the usual answer).'strict-dynamic'makes browsers ignore host lists and'unsafe-inline', so those are not counted against it. - Weak when only
Content-Security-Policy-Report-Onlyis sent. That header reports violations but blocks nothing. - Several policies (several headers, or one header with commas) are all enforced: a script must pass every one, so the strictest decides.
The suggested value starts from the site's own policy and adds object-src 'none', base-uri 'self' and frame-ancestors where they are missing. Without a policy, it starts from default-src 'self'; img-src 'self' data:; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'self', which will probably flag your analytics and inline scripts: that is the point of trying it first. More on changing CSP in the browser: modify Content-Security-Policy and other response headers.
Test a Content Security Policy before deploying it
- Edit the suggested policy in the table and leave the mode on Report-Only.
- Import the profile into HeaderDial and browse the site with the DevTools Console open. Each resource the policy would block is listed there, but the page keeps working.
- Add the sources you trust to the policy (or move inline scripts into files, or give them a nonce on the server), and repeat until the Console only lists things you want blocked.
- Switch the mode to enforce to see the page with the policy applied. HeaderDial's
setreplaces the server's ownContent-Security-Policyheader with yours on that host. Then put the policy on the server.
A policy in a <meta http-equiv="Content-Security-Policy"> tag is part of the HTML, not a header, so this checker does not see it and a header rule does not replace it. Both apply.
To write a policy from scratch, or edit one directive by directive with a warning for each weak spot, use the CSP builder, which makes the same kind of Report-Only test profile.
X-Frame-Options and frame-ancestors
Both decide which sites may show the page in an <iframe>, which stops clickjacking (a hidden frame of your page under a fake button). When an enforced CSP has frame-ancestors, browsers ignore X-Frame-Options, so the checker rates frame-ancestors first: 'none', 'self' or a list of hosts is good; * or https: lets every site frame the page. Otherwise X-Frame-Options: DENY or SAMEORIGIN is good. ALLOW-FROM is obsolete and current browsers ignore it, so the page can be framed by anyone. If the header carries conflicting values (DENY, SAMEORIGIN), the HTML standard says to block framing entirely. To embed a site you are testing despite these headers, see remove X-Frame-Options and frame-ancestors while testing.
Strict-Transport-Security (HSTS)
HSTS makes the browser use HTTPS for the host for max-age seconds, even when someone types http:// or follows an old link. The checker rates it weak below 6 months (15552000 seconds), at max-age=0 (which deletes the policy), without a valid max-age, and when a directive appears twice: the RFC says such a header is ignored. With preload it also checks the preload list's requirements: at least one year (31536000) and includeSubDomains. A response that arrived over plain HTTP gets not applicable, because browsers ignore HSTS there. If several HSTS headers are sent, browsers use only the first.
The suggested test value is max-age=300 on purpose: the browser stores an HSTS policy and keeps it after you switch the profile off, so a test should expire quickly. Deploy with max-age=31536000; includeSubDomains once every subdomain serves HTTPS. To remove a stored policy, see remove or change HSTS while testing.
X-Content-Type-Options
The only value is nosniff. With it, browsers refuse to run a response as a script or apply it as a stylesheet unless its Content-Type says it is one, and they stop guessing the type of other responses. Anything else is ignored, so it is rated weak. It is the one header here that matters on every response, not just pages. Before deploying, try it: a script served as text/plain will stop loading.
Referrer-Policy
It controls how much of the page's URL is sent in the Referer header when the page loads resources or the user follows a link. URLs can hold search terms, IDs or reset tokens, so the full URL should not go to other sites. unsafe-url (full URL everywhere, even over HTTP) and no-referrer-when-downgrade (full URL to every HTTPS site) are rated weak; strict-origin-when-cross-origin, strict-origin, same-origin, origin and no-referrer are good. The header can list fallbacks separated by commas; browsers use the last value they understand, and so does the checker. Without the header, current browsers use strict-origin-when-cross-origin, so a missing header is a small gap.
Permissions-Policy
It switches browser features off for the page and the iframes in it, for example camera=(), microphone=(), geolocation=(). It is optional hardening: rated missing when absent, weak when it is written in the old Feature-Policy style (camera 'none') or does not parse, because browsers drop an unparseable header entirely. Feature names must be lower case.
Cross-Origin-Opener-Policy, -Embedder-Policy and -Resource-Policy
- COOP (
Cross-Origin-Opener-Policy): withsame-origin, a cross-origin page that opens yours, or that you open, loses its handle to your window, which closes a family of cross-site leaks.same-origin-allow-popupskeeps the popups you open (sign-in and payment windows) working. Missing on a page is rated missing;unsafe-noneis the default and rated weak. - COEP (
Cross-Origin-Embedder-Policy):require-corporcredentialless, together with COOPsame-origin, makes the page cross-origin isolated, which is needed forSharedArrayBufferand precise timers. It can block third-party embeds, so a missing COEP is not applicable unless you need isolation. - CORP (
Cross-Origin-Resource-Policy):same-originorsame-sitestops other sites from loading the response with<img>,<script>and similar no-cors requests;cross-origindeclares it public, which suits CDNs. Rated missing when absent.
Set-Cookie
Each cookie gets its own row with only its name and attributes; the value is never shown. A cookie is weak without Secure (it also travels over plain HTTP), without HttpOnly (page scripts, and so an XSS bug, can read it; leave it off only for a cookie your JavaScript must read), and without SameSite (Chrome treats it as Lax, other browsers may send it on cross-site requests). Browsers reject outright a SameSite=None cookie without Secure, a __Secure- cookie without Secure, and a __Host- cookie that lacks Secure or Path=/ or has a Domain. A cookie with Max-Age=0 or an Expires date in the past is being deleted, so it is not applicable. Cookie attributes are set by the server code, so the fix table has no row for them; to test cookies from the browser side, see test with Cookie and Set-Cookie headers.
CORS (Access-Control-Allow-Origin)
Without CORS headers, scripts on other sites cannot read the response, which is the safe default, so the row is not applicable. * lets any site read it without cookies, fine for public data. * together with Access-Control-Allow-Credentials: true is invalid and browsers block such credentialed requests; the dangerous "fix" is to echo back whatever Origin arrives, which hands logged-in data to every site. null is weak because any page can get a null origin from a sandboxed iframe, and two origins in one header are invalid. A specific origin is good; if the server picks it per request, it should also send Vary: Origin. To add CORS headers while developing against an API, see add Access-Control-Allow-Origin for local testing.
Server, X-Powered-By and X-XSS-Protection
A Server value with a version number (nginx/1.18.0, Apache/2.4.41 (Ubuntu)) tells an attacker which known vulnerabilities to try; the product name alone is fine. X-Powered-By, X-AspNet-Version and X-AspNetMvc-Version do nothing for the browser and are rated weak whenever present. The checker shows X-XSS-Protection only when it is sent: 0 is good, anything else is weak, because current browsers no longer have the filter it controlled and in older ones the filter itself could leak information. A CSP is the replacement.
What the checker does not cover
- Only the headers you paste: one response. Other URLs on the same site may send different headers, and with redirects only the last response is checked.
- CSP in
<meta>tags, the HSTS preload list itself, TLS settings, mixed content, and whether a policy actually breaks your page (that is what the HeaderDial test is for). - Policies are checked for the common problems listed above, not fully validated: a typo in a directive name, or a nonce that is the same on every response, is not detected.
- Whether a header suits your site. A rule that is right for a bank can break an embeddable widget.
Import the profile into HeaderDial
- Tick the fixes, check the host after Only on, and click Copy share link. Open the link: the share page shows the response-header rows. The profile is in the link after the
#, which browsers do not send to any server. - Copy the share page's address, open HeaderDial, click Import…, paste it and click Import. Or click Download JSON and choose that file in the same dialog.
- Reload the site with DevTools open, and check the new headers under Response Headers. Some headers (CSP, framing, COOP) apply when the page loads, so reload rather than navigate inside a single-page app. Switch the profile off, or press Alt+Shift+D to pause all profiles, when you are done.
The profile only changes what your browser receives. Visitors keep getting the server's headers until you deploy the change.
Sources
The rules above follow these documents; the wording on this page is our own.
- W3C, Content Security Policy Level 3; MDN, Content-Security-Policy and script-src
- RFC 6797, HTTP Strict Transport Security; hstspreload.org submission requirements
- WHATWG HTML, The X-Frame-Options header; MDN, X-Frame-Options
- WHATWG Fetch, X-Content-Type-Options, the CORS protocol and Cross-Origin-Resource-Policy
- W3C, Referrer Policy; W3C, Permissions Policy; RFC 8941, Structured Field Values
- WHATWG HTML, Cross-origin opener policies and Cross-origin embedder policies
- IETF, Cookies: HTTP State Management Mechanism (RFC 6265bis draft); MDN, Set-Cookie
- RFC 9110 §10.2.4, Server; MDN, X-XSS-Protection
Add to ChromeFirefox: coming soon