Parse, visualize, and audit a Content-Security-Policy header, then optionally fetch a live policy from any URL.
CSP analyzer takes a Content-Security-Policy header value and breaks it into three views:
default-src fallback resolution.The parsing and audit run entirely in your browser. The only server interaction is the optional "Fetch from URL" feature (see below), which retrieves a remote header — analysis still happens client-side.
Paste a header value into the Policy box. You can paste either the bare value:
default-src 'self'; script-src 'self' 'unsafe-inline'…or the full header line — a leading Content-Security-Policy: (or Content-Security-Policy-Report-Only:) prefix is stripped automatically.
Click Sample to load an intentionally flawed policy and see the audit in action.
Script execution risks:
'unsafe-inline' in script-src (and whether a nonce/hash/'strict-dynamic' neutralizes it for modern browsers)'unsafe-eval' and 'unsafe-hashes'* and scheme-only sources (https:, http:, data:) in script-src'strict-dynamic' (informational, with caveats)Missing protections:
default-src fallbackobject-src not locked to 'none'base-uri (base-tag injection)frame-ancestors (clickjacking)form-action'unsafe-inline' in style-srcHygiene:
report-uri without report-toCSP has a subtlety that trips people up: most fetch directives (script-src, img-src, connect-src, …) fall back to default-src when omitted — but base-uri, form-action, and frame-ancestors do not. The Effective policy table resolves each directive and labels how its value was derived:
default-srcBrowsers cannot read another site's response headers from client-side JavaScript (CORS blocks it), so the Fetch button calls a small server endpoint (/api/csp-fetch) that retrieves the target's headers and returns only the CSP-related ones. The retrieved policy is dropped into the Policy box and analyzed client-side as usual.
The fetch endpoint is hardened against SSRF:
http/https URLs are allowed.localhost, private, loopback, link-local, and cloud-metadata addresses are refused — including after DNS resolution and on every redirect hop.The current policy is stored in the URL as ?policy=…, so you can share an analysis or reload it later.
/csp?policy=default-src%20'self'%3B%20script-src%20'self'%20'unsafe-inline'Use the Copy button in the Permalink row to copy the URL, or Reset to clear everything.