A broken Content Security Policy gives teams false confidence while still allowing inline script execution. The CLI checks concrete directives across every crawled page and writes baseline directives for Nginx, Caddy, and Apache.
When a response has no Content-Security-Policy header, the scanner emits HDR-CSP-MISSING. When a policy exists, the parser inspects individual directives and raises HDR-CSP-WEAK for specific bypass conditions:
'unsafe-inline' or 'unsafe-eval' inside script-src or default-src* sources in script execution directives or cleartext http: origins on HTTPS pagesobject-src 'none' or missing base-uri restrictions that allow base tag hijackingframe-ancestors when X-Frame-Options is also absentweb-vuln-scanner https://example.com --max-pages 20 --fix-config nginx --hide-passes
Example strict starter directive generated by --fix-config nginx when CSP is missing:
add_header Content-Security-Policy "default-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self'" always;
If script-src allows 'unsafe-inline', an attacker who injects an inline script block bypasses the domain whitelist completely.
Deploy Content-Security-Policy-Report-Only in staging first, verify browser reports are clean, then switch the header to enforcement mode and re-scan with --baseline.
Inspect all seven core HTTP security headers in one scan.
Export complete header blocks tailored to detected findings.
Pair CSP with Subresource Integrity on external CDN scripts.