How to read a CSP violation report
Most CSP reports are harmless, and a few matter a lot. This is what the fields mean, and how to tell which is which.
An example
Chrome sent this to a report-uri address when a page tried to load a script its policy did not allow:
{
"csp-report": {
"document-uri": "https://shop.example/",
"referrer": "",
"violated-directive": "script-src-elem",
"effective-directive": "script-src-elem",
"original-policy": "default-src 'self'; report-uri /r",
"disposition": "enforce",
"blocked-uri": "https://cdn.example.com/a.js?x=1",
"status-code": 200,
"script-sample": ""
}
}What the fields mean
- document-uri
- The page it happened on.
- effective-directive
- The rule that was broken, at its most specific. Here the policy has only
default-src, and the browser still saysscript-src-elem. - blocked-uri
- What broke it: a URL, or a word such as
inline,eval,dataorblob. - disposition
enforcemeans it was blocked.reportmeans it was only reported, so it loaded.- source-file, line-number
- The script that caused it. Often missing, and not always right.
- script-sample
- The first 40 characters of an inline script or style, if the directive includes
'report-sample'. - original-policy
- The whole policy the browser had. If it is not yours, a proxy or extension changed it.
How much of a URL you get
It varies. When we tested Chrome 156, it sent the full address of a blocked script on another site, with its query string, but only the origin of a blocked frame. MDN says addresses on other sites are cut down to the origin, and some browsers do that.
Query strings can hold email addresses, tokens and search terms, so remove them before you store a report. CSP Inbox does this for you. Group reports by host, or the same problem will look like hundreds.
Reports you can ignore
These come from software on the visitor's computer, and no change to your site will stop them:
- addresses starting
chrome-extension:,moz-extension:orsafari-web-extension: - hosts that belong to antivirus products, password managers, shopping assistants or page translators
- inline violations seen in one browser by a handful of people, on pages where everyone else has none
- a
document-urithat is not your domain, such as a saved or proxied copy of your page
Do not add any of these to your policy. Allowing a host to quieten a report weakens the policy for everyone.
What to look at first
- Unknown script and form hosts on payment, sign-in and account pages. Look closely for names that imitate one you use, such as
googie-analytics.com. - Anything enforced that started suddenly. It is probably a feature that broke in your last release, or a vendor that moved to a new host.
- Your own domains. Usually a missing
www, a subdomain, or a page that moved. - Known third parties. Decide whether you still need each one, then allow it or remove it.
- Inline code. The most work, and where most of the protection comes from.
Last checked 24 November 2026.