Free Content Security Policy (CSP) Evaluator
Paste a Content-Security-Policy and get an A-F grade · with specific fixes for unsafe-inline, unsafe-eval, wildcards, and missing directives.
Pasted policies are evaluated in your browser. Fetching a URL sends that URL to SimplyScan to read its public headers and HTML.
Preview · sign in with a free account to run it
How to use it
- Paste the value of your Content-Security-Policy header, or enter a URL to fetch the policy the site sends.
- Read the grade from A to F and the findings, from dangerous to informational.
- Apply the fix each finding suggests, such as nonces instead of 'unsafe-inline', or adding object-src 'none'.
- Paste the new policy to confirm the grade went up before you deploy it.
Example
Input
default-src 'self'; script-src 'self' 'unsafe-inline'; object-src 'none'
Result
Grade D · 49 / 100 ✗ script-src allows 'unsafe-inline' · inline scripts run freely, defeating most XSS protection. Use nonces or hashes instead. ⚠ No base-uri · an injected <base> tag can hijack relative URLs. ⚠ No frame-ancestors · the page can be framed (clickjacking).
What the findings cost
- No default-src or script-src (−40)
- Nothing restricts which scripts may run, so the policy gives no protection against cross-site scripting.
- 'unsafe-inline' in script-src (−35)
- Any inline script runs, including one an attacker injects. Use a nonce or hash for each inline script you need.
- Wildcard source: *, https: or http: (−30)
- Scripts may load from any host, so an attacker only needs a file somewhere on the internet.
- 'unsafe-eval' (−20)
- eval() and new Function() are allowed, a common path for injected code.
- data: in script-src (−15)
- Scripts can be inlined as data: URLs.
- object-src, base-uri, frame-ancestors (−8 each)
- Missing guards against plugin content, <base> hijacking and clickjacking.
- Grade bands
- Penalties are subtracted from 100. A is 90 and above, B 75, C 60, D 45, E 25, and F below that.
A strict starting policy
Send it as Content-Security-Policy-Report-Only first, watch the browser console for blocked resources, then switch to the enforcing header.
Nonce-based policy
default-src 'self';
script-src 'self' 'nonce-{RANDOM}' 'strict-dynamic';
object-src 'none';
base-uri 'none';
frame-ancestors 'none'{RANDOM} must be a new random value on every response, and the same value goes on each <script nonce="…"> tag.
Go deeper
Page updated
Frequently asked questions
What makes a CSP weak?
The most common weaknesses are 'unsafe-inline' and 'unsafe-eval' in script-src (they defeat most XSS protection), wildcard * sources, missing object-src 'none', and no default-src fallback. The evaluator flags each and explains the fix.
Is my policy uploaded anywhere?
Pasted policy text is evaluated in your browser. The optional URL fetch sends the URL to SimplyScan, which reads the public response headers and HTML and returns its CSP policies.
My framework adds inline scripts. Do I need 'unsafe-inline'?
Usually not. Next.js, Remix and most SSR frameworks can attach a nonce to the scripts they generate. Static sites can use hashes of each inline script instead.
Is a weak CSP worse than none?
Not worse, but a policy with 'unsafe-inline' and wildcards stops almost nothing while looking protective. The grade tells you how much it actually blocks.
Want the full picture?
This tool covers one narrow check. A full SimplyScan runs 60 checks across 14 categories · exposed keys, RLS, XSS, auth, and speed · in 30 seconds.
Run a full security scanRelated tools
Password Strength Checker
Test any password's strength · entropy, estimated crack time, and detection of common patterns and dictionary words.
Email Header Analyzer
Paste raw email headers and get the story: did SPF, DKIM and DMARC pass, what path did the message take, and does anything look spoofed.
Punycode Converter
Convert Unicode domains to xn-- punycode and back · and check whether a domain mixes scripts the way phishing lookalikes do.