Security headers present (CSP, X-Frame-Options, X-Content-Type, HSTS)
Why it matters
Missing security headers leave browsers without the instructions needed to block clickjacking, MIME-type sniffing attacks, and content injection — gaps that attackers exploit through iframe embeds, malicious redirects, and injected scripts. NIST 800-53 rev5 SC-8 covers transmission integrity and SI-3 covers malicious code protection; both are satisfied in part by response headers that tell browsers what to trust. FedRAMP rev5 SC-8 applies to all cloud systems serving federal users. OWASP A05 (Security Misconfiguration) and CWE-693 (Protection Mechanism Failure) specifically call out absent security headers. A CSP header alone can neutralize most XSS payloads that slip through input validation.
Severity rationale
High because absent security headers expose every page visitor to clickjacking, MIME-confusion exploits, and reflected XSS attacks that require no server-side vulnerability to execute.
Remediation
Configure all four required headers in next.config.js at the framework level so they apply to every route including API responses.
// next.config.js
const securityHeaders = [
{ key: 'Content-Security-Policy',
value: "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:" },
{ key: 'X-Frame-Options', value: 'DENY' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'Strict-Transport-Security',
value: 'max-age=31536000; includeSubDomains; preload' }
]
const nextConfig = {
async headers() {
return [{ source: '/:path*', headers: securityHeaders }]
}
}
export default nextConfig
Verify the headers are live in production using curl -I https://yourdomain.com — not just in dev. If your CSP blocks legitimate inline scripts, migrate to nonce-based CSP rather than weakening to unsafe-inline for all sources.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the FISMA/FedRAMP Readiness Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- nist:rev5 · SC-8 — Transmission Confidentiality and Integrity
- nist:rev5 · SI-3 — Malicious Code Protection
- fedramp:rev5 · SC-8 — FedRAMP SC-8 — security headers as transport protection
- owasp:2021 · A05 — Security Misconfiguration
- cwe · CWE-693 — Protection Mechanism Failure
Taxons
History
- 2026-04-18·v1.0.0·Initial import from gov-fisma-fedramp·automated