Skip to content
SEO Optimizer is live, Audit on page SEO and AI-search readiness. Try it free
Website security

CSP evaluator

Paste a Content-Security-Policy or enter a URL to see how strong it is and which directives leave XSS open.

What the CSP evaluator checks

The weaknesses that make a CSP easy to bypass.

Unsafe sources

'unsafe-inline', 'unsafe-eval' and wildcard script sources.

Nonces and strict-dynamic

Whether scripts are locked down the modern way.

Missing directives

object-src, base-uri and frame-ancestors.

Syntax mistakes

Keywords missing their quotes, which silently do nothing.

Content-Security-Policy, explained

What does a Content-Security-Policy do?

A CSP is a response header that tells the browser which sources a page may load scripts, styles, images, frames and other content from. If an attacker manages to inject a script, a strict policy stops the browser from running it, which makes CSP one of the strongest defenses against cross-site scripting.

What is a strict CSP?

A strict CSP allows scripts by nonce or hash instead of by domain, often with 'strict-dynamic' so scripts you trust can load others. It avoids 'unsafe-inline' and wildcard sources, and sets object-src 'none' and base-uri 'none' to close common bypasses.

How do I roll out a CSP safely?

Start with Content-Security-Policy-Report-Only and collect violation reports from real traffic. Fix or allow what breaks, tighten the policy step by step, then switch to enforcing. Re-check the policy whenever you add a third-party script.

How it works

Paste or enter a URL

Evaluate a policy directly or fetch it from a live site.

We parse every directive

Each one is checked against known bypasses.

Tighten the policy

Follow the findings to close the gaps.

A CSP is one layer of XSS defense. Roll out changes in report-only mode first so you don't break your site.

FAQ

Questions

A strict policy uses nonces or hashes with 'strict-dynamic', sets object-src 'none', base-uri and frame-ancestors, and avoids 'unsafe-inline'.

It lets any injected inline script run, which defeats most of the protection a CSP gives against XSS.

Yes. Paste it here, then ship it as Content-Security-Policy-Report-Only and watch the reports.

No. The browser checks each resource against the policy as it loads, which adds no noticeable time.

Yes, with limits: frame-ancestors, report-uri and sandbox don't work in a meta tag. A response header is the better choice when you control the server.

More free tools and audits

Free - no sign-up required

Check every security header

Grade CSP, HSTS, X-Frame-Options and more on your live site.

Run free audit