Security Headers Grader and What Header Grades Really Show
Security headers are one of the clearest external signals of browser-side hardening. Security Headers Grader shows how to inspect CSP, HSTS, framing controls, nosniff, and related policies, and what to verify beyond the score.
Security headers sit in the gap between a working site and a defensible site. Many teams ship pages with correct business logic, valid TLS, and clean UI, yet leave the browser with weak instructions. When that happens, the browser fills in defaults. Those defaults often favor compatibility over safety.
For a practitioner, this matters because headers are one of the few controls you can verify from outside the stack. You do not need repo access or production credentials to inspect them. You need a URL, a response, and a clear idea of what each header asks the browser to do. That makes headers a useful checkpoint in reviews, migrations, vendor assessments, and routine hardening.
Security Headers Grader focuses on this narrow but important layer. It grades a site’s HTTP security headers, including CSP, HSTS, framing controls, and X-Content-Type-Options: nosniff. What it demonstrates is straightforward engineering discipline. Small response fields shape large parts of browser behavior. If you treat them as first-class configuration, you reduce whole classes of avoidable exposure.
What headers are for, and why they fail quietly
Security headers are policy statements attached to HTTP responses. The browser reads them before or while it renders a page. Some limit what scripts, styles, frames, or connections are allowed. Some tell the browser to keep using HTTPS. Some stop MIME sniffing, where the browser guesses a file type instead of trusting the declared one.
The key failure mode is silence. A missing Content-Security-Policy does not break the page. A missing X-Frame-Options often does not change the page in normal use. Weak Referrer-Policy values do not trigger visible errors. The site looks fine until an attacker finds room in the gaps.
This is why header work drifts. Teams notice broken rendering right away. They do not notice absent policy until a review, an incident, or a customer questionnaire. A grader helps because it turns silent omissions into visible findings.
A few examples of what these headers cover:
Content-Security-Policylimits where active content and other resources load from.Strict-Transport-Securitytells browsers to prefer HTTPS for future requests.X-Frame-Optionsor CSPframe-ancestorslimits framing by other pages.X-Content-Type-Options: nosniffstops certain content-type guessing.Referrer-Policycontrols how much URL context is sent on outbound requests.Permissions-Policylimits access to browser features such as camera or geolocation.
None of these replace input validation, authentication, or server-side controls. They narrow the browser-side attack surface. That is their job.
What to inspect in a grade
A grade is only useful if you know what is behind it. When you inspect a site, read past the letter or score and look for concrete header presence, values, and interactions.
Start with CSP. Presence alone is not enough. A policy with broad allowances defeats much of the point. You want to inspect whether the policy is specific, whether it avoids patterns that weaken script control, and whether it covers the directives your app needs. A modern app often needs a careful policy because frontend tooling, CDNs, and third-party widgets create pressure to loosen it.
Then look at HSTS. The engineering question is simple. Once a browser reaches the HTTPS version of your site, does the site tell the browser to stay on HTTPS for later visits? If HSTS is absent, first-contact downgrade risks stay open. If the value is present but scoped weakly, protection is partial.
Framing controls come next. Older deployments use X-Frame-Options. Newer ones often rely on CSP frame-ancestors. What matters is whether your pages are protected from being embedded in hostile contexts, except where you intentionally support embedding. Login pages, payment steps, admin panels, and consent flows often deserve tighter rules than marketing pages.
nosniff is easy to miss because it is small and low drama. It still matters. If your server labels resources inconsistently, browsers have historically guessed. That guessing creates room for content to be treated as active when it should not be.
Finally, review adjacent controls. Referrer-Policy reduces unnecessary leakage of internal paths or query data. Permissions-Policy trims access to browser features your site does not need. These are not decorative extras. They express least privilege at the browser edge.
How you would verify the claims yourself
The useful thing about response headers is reproducibility. You can verify them from the browser, command line, or a network proxy. A grading tool gives structure, but the underlying evidence is public.
In a browser, open developer tools, load the page, and inspect the main document response under the Network panel. You are looking for the response headers returned by the origin or final edge layer. Check whether a redirect response differs from the final HTML response. Some teams set headers on one and forget the other.
At the command line, a simple request shows the response fields:
curl -I https://example.com/
For redirect paths, inspect each hop:
curl -I -L https://example.com/
Verification is more than presence. Compare the values to the site’s behavior. If CSP blocks inline scripts, does your page still rely on inline bootstrapping. If framing is denied, do any legitimate partner embeds stop working. If HSTS is present, is the whole user-facing surface consistently on HTTPS.
You should also test multiple page types. Homepages are often better maintained than login pages, admin paths, static asset responses, or error pages. Reverse proxies and CDNs sometimes apply different header sets by path pattern or status code. A clean result on / does not prove consistency elsewhere.
A second useful check is inheritance across stack layers. Application code, framework middleware, web server config, and CDN rules all have ways to inject or override headers. When a value looks strange, the fault is often not in the app itself. It is in the final layer that mutates responses before they reach the browser.
Where this class of system commonly goes wrong
The most common mistake is treating security headers as a one-time checklist item. Teams paste a sample config into a server block, get past review, then let the app evolve until the policy no longer matches reality. Frontend builds change. Vendors are added. New subdomains appear. The browser policy stays frozen.
CSP is where this mismatch shows up most often. Under deadline pressure, teams loosen the policy until the page works. They allow wide sources, add exceptions without review, or rely on patterns that erase most of the protection. The page renders, the header exists, and the grade looks better than the risk posture.
Another frequent issue is partial deployment. HSTS appears on the apex domain but not on subdomains that users still reach. Framing controls exist on HTML pages but not on sensitive flows served from a different origin. nosniff is present on the document response but absent on script or style responses because static assets come from another tier.
There is also the compatibility trap. Some legacy apps or embedded flows need framing, inline code, or broad resource loading to function. The wrong response is to disable all controls. The better response is to map which pages need exceptions, isolate them, and keep the stricter baseline elsewhere.
Status codes are another weak point. Error pages, redirects, and cached responses often bypass the normal middleware path. If your 200 responses are hardened but your 404, 500, or 302 responses are not, you have configuration drift. Attackers and testers both notice edge cases.
Finally, teams confuse related controls. TLS is not HSTS. A login page over HTTPS without HSTS still leaves a first-visit gap. A frame restriction is not a CSP replacement. nosniff does not solve unsafe script sourcing. Each header covers a specific browser behavior. Read them that way.
Signals worth reading during reviews
When you review a site with a header grader, focus on signals that change your next step.
- Missing CSP, or a CSP present only in report-only mode.
- HSTS absent on HTTPS pages, or present only on part of the surface.
- Framing controls missing on login, account, checkout, or admin pages.
nosniffabsent where static assets or uploads are served.- Weak or missing
Referrer-Policyon pages with sensitive URL parameters. Permissions-Policyabsent on sites that do not need browser features.- Inconsistent headers across redirects, subdomains, or status codes.
These are investigation prompts. They tell you where to inspect deployment paths, page classes, and ownership boundaries. They do not tell you everything about the site’s security posture. Header results are one layer. Still, they are a useful layer because they are externally visible, testable, and easy to regress if no one owns them.
What to watch next
The next step for teams is consistency. Put header policy under version control. Test it in CI against representative routes. Recheck after CDN, framework, or auth-flow changes. Treat exceptions as design decisions, not drift.
For readers, the larger lesson is simple. Browser security behavior is configurable, and those settings are inspectable from the outside. A tool like Security Headers Grader is useful because it makes hidden defaults visible. Once you see them, you know where to tighten the system.