How to read CSP violation reports
Content-Security-Policy can send violation reports to an endpoint you configure. The JSON names what was blocked and which directive applied. Reports are noisy; extensions and prefetch show up too.
Two report shapes
Classic report-uri (and report-to) posts a JSON body with a top-level csp-report object. Fields use kebab-case: effective-directive, blocked-uri, document-uri, original-policy.
The Reporting API delivers batches (often an array of objects) with camelCase fields such as effectiveDirective, blockedURL, and body nested under each entry. Same meaning, different wrappers.
Fields that matter
effective-directive/effectiveDirective— the directive that blocked the load (e.g.script-src,connect-src).blocked-uri/blockedURL— what was denied: a URL,inline,eval, ordata:.source-file— script file and line for inline violations; useful for tracking which bundle injected code.disposition—enforcevsreport(report-only policies still generate reports).original-policy— the policy string in force when the violation occurred.
False positives and noise
Browser extensions inject scripts and hit script-src. That does not mean your site is broken for real users without the extension.
Prefetch, prerender and third-party tags you do not control can flood reports. Filter by document-uri before widening CSP.
blocked-uri: inline usually means inline script or style without a matching nonce or hash — not a remote URL to allowlist.
Turning a report into a directive change
Prefer nonces or hashes for your own inline script over unsafe-inline. For a trusted third-party host, add its origin to the effective directive only after you intend to load that resource.
Do not copy ToolDeck’s suggestion blindly. It formats an example allowlist line; you still decide trust and scope.
- Third-party script host → consider
script-srcwith that origin, or self-host the asset. - API call blocked → often
connect-src, notscript-src. - Embedded iframe blocked → check
frame-src/child-src(legacy) and the child URL.
What ToolDeck does
Paste the raw JSON from your server logs or browser. The page parses it in memory and explains the violation. The report is not uploaded to ToolDeck or sent anywhere else.
Questions
- What is the difference between violated-directive and effective-directive?
- Older reports used
violated-directive. Modern ones prefereffective-directive(the one that actually blocked). ToolDeck accepts both. - Why is blocked-uri empty?
- Some violations (policy parse errors, worker edge cases) omit a URI. Read
source-fileand the policy string instead. - Do report-only policies block users?
- Report-only sends telemetry without blocking.
disposition: reportin the payload tells you the load was allowed but logged. - Should I paste production reports into a random website?
- Reports can contain full page URLs and query strings. ToolDeck processes them locally; still avoid pasting secrets into any tool you do not trust.
See also
Related tool: CSP violation explainer. Runs in your browser; input is not uploaded.