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
What the check looks at
Once a day we request the home page of the domain over HTTPS and look for four protections:
- a
Content-Security-Policyheader; X-Content-Type-Options: nosniff;- protection against framing:
frame-ancestorsin the CSP, or anX-Frame-Optionsheader; - a
Referrer-Policyheader.
The check warns when some are missing and fails when all four are, and the finding lists the missing ones.
Risk
| Header | What it limits |
|---|---|
Content-Security-Policy |
Where scripts and other resources may load from. When an attacker injects HTML (cross-site scripting, first in the 2025 CWE Top 25), a strict policy keeps the injected script from running. |
frame-ancestors or X-Frame-Options |
Which sites may show your pages in a frame, invisible frames for clickjacking included. |
X-Content-Type-Options: nosniff |
Browsers treating an uploaded text file as a script or stylesheet. |
Referrer-Policy |
How much of your URLs other sites see when users follow links; URLs can carry tokens or search terms. |
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 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. 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 returns only JSON. CSP and frame protection do little there; send
nosniffand a minimalContent-Security-Policy: default-src 'none'; frame-ancestors 'none'. - A widget that other sites embed. Set
frame-ancestorsto the sites allowed to embed it.
Sources
- Content Security Policy Level 3, W3C (directives, report-only, frame-ancestors)
- MDN: X-Content-Type-Options, Referrer-Policy, X-Frame-Options
- 2025 CWE Top 25 (CWE-79 ranked first)
- Header settings tested with nginx 1.26.3, Apache 2.4.71 and Caddy 2.6.2 on Debian on 2026-11-26