Start a project

Tool 178 of 194 · Security

CSP Violation Report Analyser

Paste the CSP violation reports your site collects and see which ones matter, which are noise, and what to change in your policy.

CSP Violation Report Analyser at a glanceIllustration: 1, Violation reports; 2, processed in your browser; 3, Safer policy.CSP Violation Report Analyser1Violation reports3Safer policy2In yourbrowser
1 Violation reports 2 processed on your device 3 Safer policy

CSP Violation Report Analyser

Reports and policy

    Real violations, grouped

    DirectiveSourceReportsPagesWhat to do

    Proposed policy

      Proposed policy

      Check it with the CSP evaluator, then run it as Content-Security-Policy-Report-Only for a week before you enforce it.

      Reports by directive

      01

      What it does

      Groups CSP violation reports by directive and source, filters out extension and browser noise, and proposes the smallest safe change to your policy.

      • Legacy report-uri JSON, Reporting API batches and one report per line, mixed
      • Noise filtered: extensions, browser-internal and injected sources
      • Grouped by directive and source origin, with page counts
      • A fix for each group: a host to allow, a nonce or hash, or code to change

      02

      Private by design

      Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

      03

      What you get

      Grouped violations, a noise count and a proposed policy, with a Copy and a Download button on every result.

      • CSP
      • Security
      • Reporting
      • Headers

      Why it matters

      Rolling out a Content Security Policy in report-only mode is the right move, but it produces a flood of reports: thousands of JSON blobs, most of them from browser extensions, password managers and translation tools injecting their own scripts. The few that matter, a payment script you forgot or an inline snippet from your analytics, get lost, and teams either give up or loosen the policy until the reports stop.

      This analyser reads both report formats, sorts out the noise (extension URLs, browser-internal sources, software that injects scripts into every page), and groups the rest by directive and source origin. Each group gets a recommendation that keeps the policy tight: allow a specific origin, give an inline script a nonce or hash, or remove the eval() call rather than adding 'unsafe-eval'. The additions are merged into your current policy using the same parser as the CSP evaluator. Reports stay on your device.

      How it works

      1. InputCSP reports and your current policy
      2. In your browserNoise filtered, the rest grouped by directive and source
      3. OutputA fix per group and a merged policy

      Where it fits in a designer's workflow

      1. Plan
      2. Design
      3. Build
      4. Test
      5. Launch
      Getting a CSP from report-only to enforced.

      By the numbers

      Reports by directive in the sample, with noise split offscript-src-elem: 3 reports; img-src: 2 reports; font-src: 1 report; script-src: 1 report; connect-src: 1 report; Noise: browser extension: 3 reportsscript-src-elem3 reportsimg-src2 reportsfont-src1 reportscript-src1 reportconnect-src1 reportNoise: browser extension3 reports
      Counted by this tool from its 11 sample reports in both formats: 3 came from browser extensions and were set aside, and the rest fell into 6 groups, leading to 4 policy changes. The inline script and eval() groups need code changes rather than new sources. Source: W3C: Content Security Policy Level 3, reporting; MDN: CSP violation reports.
      Show the numbers as a table
      DirectiveSourceReports
      script-src-elemhttps://js.stripe.com2
      img-srcdata:2
      script-src-eleminline1
      font-srchttps://fonts.gstatic.com1
      script-srceval1
      connect-srchttps://region1.google-analytics.com1

      How to use it

      1. Export or copy the reports your endpoint has collected.
      2. Paste them, along with your current policy.
      3. Ignore the noise, read the grouped violations and their fixes.
      4. Copy the proposed policy and test it in report-only mode.

      FAQ

      Why are there so many reports from extensions?

      Extensions inject scripts and styles into the pages you visit, and your policy blocks them like any other source. You can't fix that and shouldn't allow it, so those reports are counted as noise.

      Can I hash the inline script from the report's sample?

      No. Browsers include only the first 40 characters as a sample, and a hash has to cover the whole script exactly. Hash the full block from your source, or give it a nonce.

      What's the difference between report-uri and the Reporting API?

      report-uri is the older directive; browsers POST one {"csp-report": ...} object per violation. The newer report-to directive sends batches through the Reporting API, with camelCase fields. Many sites send both; this tool reads either.

      Should I add 'unsafe-eval' or 'unsafe-inline' to stop the reports?

      Avoid it. Both let injected code run, which is most of what CSP protects against. Find the library that uses eval, or move inline code into files or give it a nonce.

      Is anything uploaded?

      No. Reports can include page URLs and user paths, so everything is analysed in your browser.

      Work with me

      Want a site that gets these right?

      I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

      All developer tools · Back to leej.uk