CSP Validator
Validate a Content Security Policy string against the W3C spec. Flags unsafe directives, missing protections, and syntax errors.
Validate a Content Security Policy string against the W3C spec. Flags unsafe directives, missing protections, and syntax errors.
Validates a Content Security Policy string against the W3C CSP Level 3 spec. Scores your policy 0-100. Flags unsafe-inline in script-src, missing frame-ancestors, missing object-src, and wildcard sources. Paste a CSP string or enter a URL to fetch the live policy.
CSP Validator parses your Content Security Policy string and checks it against the W3C spec. It flags unsafe directives like unsafe-inline and unsafe-eval in script-src, missing object-src and default-src, wildcard sources, and HTTP sources that should be HTTPS.
unsafe-inline in script-src allows any inline script tag to execute, including injected ones. It effectively disables XSS protection from CSP. Replace it with nonces or hashes for inline scripts you control.
A baseline CSP should include default-src 'self', object-src 'none', base-uri 'self', and frame-ancestors 'none'. These four directives block the most common injection vectors without breaking most sites.
Yes — enter your URL in the live fetch field and CSP Validator reads the Content-Security-Policy header from your actual server response. No proxy or backend is involved.