CSP Builder & Analyzer
Build a Content-Security-Policy and analyze an existing one for weaknesses.
- Input and output stay in memory and are gone when you leave this page.
Nothing saved
Input and output stay in memory and are gone when you leave this page. - Processing happens in this page. No application server receives your input.
Runs in your browser
Processing happens in this page. No application server receives your input.
Policy
Findings
Paste a Content-Security-Policy header or toggle directives in the builder below to inspect its directives and security findings.
Build
What this tool does
Parses a Content-Security-Policy header value into its directives, reports the weaknesses in it with a severity and an explanation, and builds a policy from a directive editor in the other direction.
Several Content-Security-Policy headers, one per line, intersect: the findings and the builder show the effective policy, which allows only what every one of those headers allows.
Why default-src is not enough
default-src does not cover everything: base-uri, form-action, frame-ancestors, sandbox, report-uri / report-to, and upgrade-insecure-requests do not fall back to default-src.
base-uri: Does not fall back todefault-src. Without it, an injected<base href>re-points every relative URL on the page.form-action: Does not fall back todefault-src. Without it, an injected form posts credentials to an attacker's origin.frame-ancestors: Does not fall back todefault-src. Without it, the page can be framed for clickjacking.'unsafe-inline'alongside a nonce or hash: CSP Level 3 browsers ignore'unsafe-inline'when a nonce or hash is present inscript-src, keeping it only as a Level 2 fallback.
Limits
Analyzes the policy text you give it. It cannot see what a page actually loads, so it cannot tell you a permitted origin is unused or a blocked one is needed: that is what the browser console is for. No report-to endpoint validation, which needs a Reporting-Endpoints header this tool does not see. It does not judge whether an allowlisted host is itself safe: script-src 'self' cdn.example.com is reported as a host allowlist, not as a vulnerability, because whether that CDN hosts an Angular bundle with a JSONP endpoint is not something a static page can know.
Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.