Checks / Web and domains

Security headers are missing

Check
http.security_headers
Severity
low
Runs
on our side, against a domain you verified
Looks at
Content-Security-Policy, X-Content-Type-Options, frame-ancestors or X-Frame-Options, Referrer-Policy
Updated 26 Nov 2026

What the check looks at

Once a day the service requests the home page of the domain over HTTPS and looks for four protections:

  • a Content-Security-Policy header;
  • X-Content-Type-Options: nosniff;
  • protection against framing: frame-ancestors in the CSP, or an X-Frame-Options header;
  • a Referrer-Policy header.

The finding lists which ones are missing.

Why it matters

  • Content-Security-Policy limits where scripts and other resources may load from. If an attacker manages to inject HTML (cross-site scripting, the first entry of the 2025 CWE Top 25), a strict policy stops the injected script from running.
  • Frame protection stops other sites from loading your pages in an invisible frame and tricking users into clicking buttons on them (clickjacking).
  • X-Content-Type-Options: nosniff stops browsers from treating an uploaded text file as a script or stylesheet.
  • Referrer-Policy controls how much of your URLs other sites see when users follow links; URLs can carry tokens or search terms.

None of them fixes a bug in your application. They limit what a bug can do.

How to fix it

Start with these values and loosen only what your site needs:

nginx:

add_header Content-Security-Policy "default-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;

Apache httpd (with mod_headers):

Header always set Content-Security-Policy "default-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'"
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"

Caddy:

header {
	Content-Security-Policy "default-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'"
	X-Content-Type-Options "nosniff"
	Referrer-Policy "strict-origin-when-cross-origin"
}

The CSP is the one that can break pages: external fonts, analytics, maps or payment forms need their origins listed. Send it first as Content-Security-Policy-Report-Only, browse the site with the developer console open, add the origins it reports, then switch to the enforcing header. If you need to frame your own pages, use frame-ancestors 'self'.

How to check the fix

curl -sI https://example.com/ | grep -i -E 'content-security-policy|x-content-type-options|x-frame-options|referrer-policy'

Then open the site in a browser and watch the console for CSP errors.

When a warning is fine

  • An API that only returns JSON: CSP and frame protection matter little there, nosniff still does. A minimal Content-Security-Policy: default-src 'none'; frame-ancestors 'none' on API responses is cheap.
  • A page meant to be embedded by others (a widget): set frame-ancestors to the sites allowed to embed it instead of leaving framing open to all.

Sources