P400Penthera live check

A CSP that controls scripts

Passive · nothing stored · your own site only · Terms

Your CSP may do nothing. A Content-Security-Policy header can be present and still let an injected script run, because the part that matters is the rule for scripts. The browser reads script-src, and falls back to default-src when there isn’t one. With neither, the policy leaves scripts alone.

Does yours control scripts?

These don’t control scripts:

This one does in part:

These do:

A policy sent as Content-Security-Policy-Report-Only controls nothing either. It only reports. Be careful with a shared host in script-src, such as a public CDN: if anyone can publish files there, an attacker can load one.

Fix it in four steps

1. See what the browser would block

Send your target policy as a report, so nothing breaks:

Content-Security-Policy-Report-Only: default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'none'

Open your main pages and watch the browser console. Each line it prints is something the policy would have blocked.

2. Deal with inline scripts

These are why most sites keep 'unsafe-inline'. You have three ways out:

3. Add what you really need

Add each third-party script by its exact host, such as your analytics provider. With a nonce, add 'strict-dynamic', and scripts you trust can load what they need.

4. Enforce it

When the console stays quiet, rename the header to Content-Security-Policy:

Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'none'

What it cannot see

Today’s checks catch the worst cases, so read the header yourself with the rules above.

A strict CSP is not a guarantee. It limits what an injected script can do, and the bug that let it in still needs fixing. A policy can also break a page, so test it first.

Check it

curl -sI https://your-domain.com | grep -i content-security-policy
npx penthera https://your-domain.com

curl prints the header the world sees. It controls scripts if it’s named content-security-policy, has script-src or default-src, and has no 'unsafe-inline', * or bare https: there. npx penthera reports a missing header, and runs the rest of a standard scan.

Or use the check on this site, which also reads your TLS, cookies and DNS, and looks for keys in your JavaScript with 24 secret patterns. Check only a site you own, as the terms say.

Check my siteFree, passive, nothing stored. Your own site only.