Free Content Security Policy checker
Would your site run a script someone injected into it? Enter your domain to read its Content Security Policy and see if it really blocks that. No login.
Content Security Policy questions
What is a Content Security Policy?
A response header, Content-Security-Policy, that tells the browser which sources a page may load scripts, styles, images and frames from. If an attacker gets a script tag into your page, the browser refuses to run it when its source is not on the list.
What does this checker test?
It loads your homepage and reads the Content-Security-Policy header, or a meta http-equiv tag if there is no header. It passes when script-src (or default-src) is set, does not allow any host, and does not allow 'unsafe-inline' without a nonce or hash.
Why does my policy only get a warning?
A policy can be set and still block nothing that matters. Common causes: it only sets frame-ancestors or upgrade-insecure-requests, script-src allows * or https:, or it allows 'unsafe-inline', which lets injected inline scripts run.
What about Content-Security-Policy-Report-Only?
Report-only mode sends reports of what the policy would block but blocks nothing, so it gets a warning. It is a good way to test a policy before you switch to the real header.
Will a CSP break my site?
It can, if it leaves out a host your pages load scripts or styles from. Start with Content-Security-Policy-Report-Only, read the reports for a few days, add the hosts you need, then send the real header.