← Home ← Codex ← DEBT ← Engine
Browse by Category
+ added · updated 7d
← Back to glossary

HTTP Security Headers Checklist

Security Intermediate
debt(d5/e3/b3/t5)
d5 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'specialist tool catches it' (d5). The detection_hints list securityheaders.com, owasp-zap, ssllabs, and lighthouse — all specialist/external scanning tools. Missing headers are not caught by a compiler or default linter; you need to actively run one of these scanners against a deployed site. They won't surface during local development unless deliberately invoked.

e3 Effort Remediation debt — work required to fix once spotted

Closest to 'simple parameterised fix' (e3). The quick_fix is essentially 'run securityheaders.com and add the six standard headers to your server config.' Adding/correcting headers is a small, well-scoped change — typically a few lines in nginx/Apache config or a middleware file. However, CSP in particular may require iterative tuning (removing unsafe-inline, adding nonces), pushing it slightly above e1 to e3.

b3 Burden Structural debt — long-term weight of choosing wrong

Closest to 'localised tax' (b3). The applies_to scope is 'web' contexts only. Once headers are set correctly at the server/middleware level, ongoing maintenance is modest — primarily CSP requires periodic review as third-party scripts change. The rest of the codebase is largely unaffected, so the structural burden is limited to the web-serving layer.

t5 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'notable trap' (t5). The misconception field explicitly states that security headers are treated as set-and-forget, when CSP in particular requires ongoing maintenance. Common mistakes reinforce this: CSP with 'unsafe-inline' (negates XSS protection), HSTS missing includeSubDomains, and setting headers in PHP rather than the web server. These are documented gotchas that most developers learn only after a problem surfaces.

About DEBT scoring →

Also Known As

security headers CSP HSTS X-Frame-Options HTTP headers

TL;DR

A set of response headers that instruct browsers to enforce security policies — CSP, HSTS, X-Frame-Options, X-Content-Type-Options, and Permissions-Policy.

Explanation

Key security headers: Content-Security-Policy (controls which resources can load — mitigates XSS), Strict-Transport-Security (forces HTTPS for a duration), X-Frame-Options / frame-ancestors (prevents clickjacking), X-Content-Type-Options: nosniff (prevents MIME sniffing), Referrer-Policy (controls what referrer is sent), Permissions-Policy (disables browser features like camera/microphone). Tools: securityheaders.com grades your headers. Add headers in nginx config, not PHP, for performance.

Common Misconception

Security headers are set-and-forget — CSP in particular requires ongoing maintenance as you add new third-party scripts; a too-loose CSP provides no protection.

Why It Matters

Missing security headers are consistently flagged in penetration tests and security audits — they are low-effort, high-impact controls that protect against entire classes of attacks.

Common Mistakes

  • CSP with 'unsafe-inline' — negates most of the XSS protection; use nonces or hashes instead.
  • HSTS without includeSubDomains — subdomains can still be attacked over HTTP.
  • Setting security headers in PHP instead of nginx/Apache — adds overhead on every request; set at the server level.
  • Not testing headers with securityheaders.com or Mozilla Observatory after deployment.

Code Examples

✗ Vulnerable
# nginx — no security headers:
server {
    listen 443 ssl;
    location / {
        proxy_pass http://app:9000;
        # No security headers — fails any security audit
    }
}
✓ Fixed
# nginx — full security header set:
add_header Strict-Transport-Security   'max-age=31536000; includeSubDomains; preload' always;
add_header X-Frame-Options             'DENY' always;
add_header X-Content-Type-Options      'nosniff' always;
add_header Referrer-Policy             'strict-origin-when-cross-origin' always;
add_header Permissions-Policy          'geolocation=(), microphone=(), camera=()' always;
add_header Content-Security-Policy     "default-src 'self'; script-src 'self' 'nonce-$csp_nonce'; style-src 'self' 'unsafe-inline'" always;
# Test at: https://securityheaders.com

Added 15 Mar 2026
Edited 22 Mar 2026
Views 56
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 1 ping F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 1 ping W 0 pings T 2 pings F 0 pings S 2 pings S 0 pings M 0 pings T 0 pings W 0 pings T 1 ping F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F
No pings yet today
No pings yesterday
Amazonbot 9 ChatGPT 6 SEMrush 5 Ahrefs 4 Google 3 Scrapy 3 Claude 2 Twitter/X 2 Perplexity 1 Bing 1 Meta AI 1 Majestic 1
crawler 31 crawler_json 7
DEV INTEL Tools & Severity
🟠 High ⚙ Fix effort: Medium
⚡ Quick Fix
Run your site through securityheaders.com — the six essential headers are: Strict-Transport-Security, Content-Security-Policy, X-Content-Type-Options: nosniff, X-Frame-Options: DENY, Referrer-Policy, and Permissions-Policy
📦 Applies To
any web
🔗 Prerequisites
🔍 Detection Hints
Missing security headers; X-Powered-By: PHP exposing version; no CSP header; HSTS not configured
Auto-detectable: ✓ Yes securityheaders.com owasp-zap ssllabs lighthouse
⚠ Related Problems
🤖 AI Agent
Confidence: High False Positives: Low ✓ Auto-fixable Fix: Low Context: File
CWE-693 CWE-116


✓ schema.org compliant