Security headers are HTTP response headers that switch on protections built into the browser. The server sends them with each page, and the browser then refuses things the site never needs: loading the page over plain HTTP, running scripts from unknown places, or showing the page inside another site's frame.
How it works
Each header covers one kind of risk. These six are the ones most checks look for:
Strict-Transport-Security(HSTS) tells the browser to reach the site only over HTTPS from now on.Content-Security-Policy(CSP) lists where scripts, styles, images and other resources may come from.X-Frame-Optionscontrols whether other sites may show the page in a frame, a defense against clickjacking.X-Content-Type-Options: nosnifftells the browser to respect the declared content type of a file instead of guessing it.Referrer-Policylimits how much of the current URL is passed on to other sites when a visitor follows a link.Permissions-Policyturns off browser features such as the camera, microphone or location for the page and the frames inside it.
A response that sets all six looks like this:
HTTP/1.1 200 OK
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Security-Policy: default-src 'self'
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()
Why it matters
The headers do not fix a vulnerability in the application, but they limit what an attacker can do with one. An injected script that the policy refuses to run, or a page that cannot be framed, turns a working attack into a failed one. Each header is a server or framework setting, so it protects every page at once.
What can go wrong
- A strict Content-Security-Policy goes live untested and blocks the site's own scripts, analytics or payment form.
- HSTS with
includeSubDomainsis sent before every subdomain serves HTTPS, and browsers that saw it can no longer reach those subdomains. - The application sets the headers, but a proxy, load balancer or CDN in front of it drops or replaces them, so visitors get a different response than the one you configured.
- A header is set in an HTML
<meta>tag, whereX-Frame-Optionsand the CSPframe-ancestorsdirective have no effect.
Check it
The Security headers checker reads any URL's response headers and shows which of these six are present and which are missing. It gives a one-time reading, so it is worth running again after a deploy or a server change.
Start monitoring today
Websites go down and code throws errors. Ranetrace tells you when it happens to yours, why it matters and what to do next.