CSP Violation Report Analyzer

Turn a pile of CSP violation reports into a short list: which directive blocked what, on which pages, which reports are browser-extension noise, and what to change in the policy.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Paste or open reports

    Paste JSON, a JSON array or one report per line, or open an exported file.

  2. 2
    Add your policy

    Paste the current policy, or leave the box empty to use original-policy from the reports.

  3. 3
    Read the groups

    Check the counts per directive and source, and hide extension noise with the checkbox.

  4. 4
    Set a threshold

    On the policy tab, choose the minimum number of reports a group needs before it gets a suggestion.

  5. 5
    Pick changes

    Tick the low-risk changes you accept; inline and eval items stay as guidance.

  6. 6
    Copy the result

    Copy the updated policy or the report-only header and export the grouped CSV for your ticket.

About this tool

A Content Security Policy tells the browser which scripts, styles, images, fonts and connections a page may use, and the browser reports every blocked load back to you. Those reports arrive as JSON, either in the older report-uri format with a csp-report object or in the Reporting API format with type csp-violation, and on a busy site they pile up in the thousands. Most are repeats, and a surprising share come from browser extensions injecting their own scripts. This analyzer reads a whole export at once, from a single JSON object, a JSON array or one report per line, and groups the reports by effective directive and blocked source. It marks extension and browser-internal noise so you can hide it, shows how many pages each problem affects, and keeps script samples where the browser sent them. A second tab turns the real problems into policy changes, with a risk label on each, and writes an updated policy plus a report-only header you can deploy safely.

What a violation report tells you

Each report names the page (document-uri or documentURL), the directive that blocked the load (effective-directive, such as script-src-elem or img-src), and what was blocked (blocked-uri). The blocked value is a URL for external resources, the word inline for inline script or style, eval for string-to-code calls, or a scheme such as data or blob. The disposition says whether the policy was enforcing or only reporting. When the policy includes 'report-sample', the browser also sends the first 40 characters of the blocked inline code, which is often enough to recognise an analytics snippet or a tag manager.

Grouping and noise

The grouped view collapses identical directive and source pairs, so 14 reports for the same tag manager script become one line with a count. External sources are reduced to their origin, because a policy allows origins, not full URLs. Reports whose blocked URL or source file starts with chrome-extension, moz-extension or safari-web-extension, and those for about: or other browser-internal URLs, are tagged as noise: the site cannot fix them and should not loosen its policy for them. A filter box narrows the list to a directive or host, and the CSV export keeps the full grouping for a ticket.

From reports to policy changes

The policy tab reads your current policy, or the original-policy field the reports carry, and works out which directive actually governs each violation, including the fallback from script-src-elem to script-src and from there to default-src. For external origins and missing 'self' it proposes adding the source to that directive, creating a specific directive rather than widening default-src. Inline code gets a nonce or hash recommendation instead of 'unsafe-inline', eval gets a refactoring note instead of 'unsafe-eval', and WebAssembly gets 'wasm-unsafe-eval'. You tick the changes you accept, and the updated policy and a Content-Security-Policy-Report-Only header line appear below with a list of remaining weak spots such as a missing object-src, base-uri or frame-ancestors.

Limits

The tool does not fetch your pages or verify that a suggested origin is trustworthy; a blocked origin can also be an injected attack, so read the list before you allow anything. Nonces and hashes have to be added by your server or build, which this page cannot do. Reports from very old browsers that lack effective-directive are grouped by the first word of violated-directive.

Worked example

A shop pastes one day of reports: 38 lines. The analyzer groups them into six problems. The top one is script-src-elem blocking https://www.googletagmanager.com, 14 reports from /checkout. Next come 9 img-src reports for https://www.google-analytics.com, 6 inline script reports with the sample window.dataLayer = window.dataLayer, 5 reports from a chrome-extension URL tagged as noise, 3 font-src reports for https://fonts.gstatic.com and 1 eval. With the threshold lowered to 1 report, the policy tab proposes adding the tag manager origin to script-src, the analytics origin and fonts origin to img-src and font-src, a nonce for the inline snippet, and a refactor note for eval. Accepting the three low-risk items turns script-src 'self' https://js.stripe.com into script-src 'self' https://js.stripe.com https://www.googletagmanager.com, and adds img-src and font-src lines.

Quick facts

Frequently asked questions

Where do I get CSP reports?

From the endpoint named in report-uri or report-to in your policy. Many teams log them to a small serverless function, a logging service or a SIEM. Export the stored JSON and paste or open it here.

Why are some reports marked as noise?

Browser extensions inject scripts and styles into every page the user visits, and your policy blocks them. Those reports come from the visitor's browser, not your site, so changing your policy for them only weakens it.

Should I add 'unsafe-inline' to stop inline reports?

Usually not. It lets any injected inline script run, which defeats the main purpose of CSP. Use a nonce generated per response, or a sha256 hash of the exact script, or move the code into a file.

What is the difference between report-uri and report-to?

report-uri is the older directive and sends a csp-report JSON object per violation. report-to uses the Reporting API, which batches reports with type csp-violation. The analyzer reads both formats, even mixed together.

Does the tool test my live site?

No. It works only on the reports you paste and never loads your pages. Deploy changes first with Content-Security-Policy-Report-Only and watch the reports drop before enforcing.

Are my reports uploaded?

No. Parsing, grouping and policy changes all run in the browser tab, and the draft is kept only in your browser's local storage so you can come back to it.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages