CSP Evaluator
- Pasted policies stay in your browser
- CSP Level 3
Evaluate a Content-Security-Policy
Introducing Vigilbase OS
The cybersecurity operating system.
Connect the security tools you already pay for. Spin up personalised dashboards in minutes, with every log and event auditable and queryable in one place.
Acme Security OS
events | where severity >= medium | last 24h- Investigate Credential-stuffing burst against /login
- Fix Rate-limit rule deployed at the edge
- Verify Attack traffic down 98% in five minutes
What is a CSP evaluator?
A CSP evaluator reads a Content-Security-Policy and reports how well it limits cross-site scripting (XSS): whether scripts are restricted to code you trust, whether 'unsafe-inline', 'unsafe-eval' or wildcards reopen the door, and whether the directives that do not fall back to default-src (base-uri, form-action and frame-ancestors) are set. Vigilbase evaluates a pasted policy in your browser and does not send it anywhere.
What the CSP evaluator checks
Script sources
The directive that governs scripts: script-src-elem, then script-src, then default-src. 'unsafe-inline' without a nonce or hash, a wildcard, a whole scheme such as https: or data:, and plain http:// hosts all let injected script run.
Nonces, hashes and 'strict-dynamic'
The strict CSP that the CSP Level 3 specification describes allows scripts by nonce or hash together with 'strict-dynamic', and sets base-uri to 'self' or 'none'. A nonce should be at least 128 bits and new for every response.
'unsafe-eval'
Lets text run as code through eval(), new Function() and similar calls. 'wasm-unsafe-eval' covers WebAssembly without it.
object-src
Controls plugin content in <object> and <embed>. object-src 'none' is the usual setting.
base-uri, form-action and frame-ancestors
These do not fall back to default-src, so each needs its own directive. frame-ancestors replaces X-Frame-Options and cannot be set in a <meta> tag.
Reporting
report-to, with report-uri as a fallback for older browsers, tells you what the policy blocks.
Syntax
Unknown or duplicate directives, keywords without quotes and values outside the source grammar have no effect, so a typo can silently weaken a policy.
How the A+ to F grade works
- A+
- 95-100
- A
- 85-94
- B
- 70-84
- C
- 55-69
- D
- 40-54
- F
- 0-39
Related checks and next steps
- CSP Generator
Build a nonce-, hash- or allowlist-based policy with server snippets.
- HTTP Security Headers Checker
Grade CSP, HSTS, X-Frame-Options and seven more response headers.
- HSTS Checker
Check Strict-Transport-Security and HSTS preload eligibility.
- A practical website protection guide
Where a CSP fits next to a WAF, DDoS protection and patching.
Managed Cloudflare
Keep Cloudflare configured, monitored and improving. Vigilbase handles agreed changes and incident response, with Core, Priority and Critical coverage options.
Explore Managed CloudflareManaged SOC
Managed SOC on the security tools you already pay for. The Vigil agent investigates, our analysts handle exceptions, and coverage follows your SLA tier.
Explore Managed SOC