Content Security Policy

CSP Reporting: Turning Violations Into Real Security Signal

How CSP reporting works: report-to vs the legacy report-uri, Reporting-Endpoints, safe Report-Only rollout, and separating real signal from noise.

A CSP header without reporting is just a guess

Most sites that deploy Content-Security-Policy never find out whether it is doing anything. The header goes out, a scanner gives it a tick, and the team moves on. But a policy that nobody watches cannot tell you when it blocks a genuine attack, when it silently breaks a feature for users on an older browser, or when a third-party script starts doing something it never used to.

Reporting is what turns CSP from a one-off header check into an ongoing signal. Every time a browser blocks something the policy disallows, it can send a small structured record back to you describing exactly what happened and where. Set that up properly, and CSP stops being a box-ticking exercise and starts being a live feed of what is actually trying to run on your pages.

How CSP reporting actually works

CSP reporting has gone through two generations of plumbing, and the overlap is where most confusion starts.

The older mechanism is the report-uri directive. It takes a URL directly in the CSP header, and any browser that supports it posts a JSON violation report straight there:

Content-Security-Policy: default-src 'self'; report-uri https://reports.example.com/csp

The current mechanism is the report-to directive. Instead of a URL, it takes the name of an endpoint, and a separate header resolves that name to an address:

Reporting-Endpoints: csp-endpoint="https://reports.example.com/csp"
Content-Security-Policy: default-src 'self'; report-to csp-endpoint

Reporting-Endpoints is the current standard, defined by the W3C Reporting API. It replaced the older Report-To header, which Mozilla's own documentation marks as deprecated and non-standard, working only in Chromium browsers. One useful distinction: CSP decides what to report, Reporting-Endpoints decides where it goes, and the Reporting API handles how it is delivered, including the retry behaviour and the application/reports+json content type.

Whichever route delivers it, the report is a structured object, though the field names differ between the two formats, which trips people up when they switch. The legacy report-uri format wraps everything in a csp-report object with kebab-case fields: blocked-uri (what was stopped), violated-directive (which rule caught it), document-uri (where it happened), disposition (enforced or report-only), plus line-number and column-number pointing at the offending script. The newer report-to format sends an array of reports with the same information under camelCase names instead: blockedURL, effectiveDirective (the closest equivalent to violated-directive, though the two can report slightly different directive text), documentURL, disposition, lineNumber and columnNumber. Either format gives you enough to debug a violation precisely, usually down to the exact line of the offending script, but a collector built for one format will silently drop fields, or whole reports, from the other.

Because report-to is not yet universally supported, the practical approach today is to send both directives, so older browsers fall back to report-uri while newer ones use report-to:

Reporting-Endpoints: csp-endpoint="https://reports.example.com/csp"
Content-Security-Policy: default-src 'self'; report-uri https://reports.example.com/csp; report-to csp-endpoint

MDN documents this as the recommended transition pattern.

Roll out with Report-Only before you enforce anything

The single most useful header in this whole topic is Content-Security-Policy-Report-Only. It is identical to the enforced header, but it blocks nothing. The browser still evaluates the policy and still sends violation reports, it just lets everything load regardless.

That makes it the right first step for any new or tightened policy:

  1. Deploy the policy in report-only mode first. Write the policy you think you need, send it as Content-Security-Policy-Report-Only, and leave the site working exactly as before for every visitor.
  2. Point it at a reporting endpoint. Add report-to (and report-uri for older browsers) so violations actually reach you rather than only appearing in a visitor's browser console.
  3. Watch for a week or two, not a day. Traffic patterns, cron-triggered emails, month-end billing pages and other low-frequency paths often only surface violations well after launch.
  4. Tune the policy against what you see. Legitimate third-party scripts, CDNs and legacy inline code usually show up clearly once you filter out the noise (more on that below).
  5. Enforce gradually. Switch the lowest-risk, lowest-traffic sections over to the enforced header first, confirm nothing breaks, then expand outward until the whole site runs the enforced policy.

Skipping straight to an enforced policy is how CSP projects get rolled back after an incident: a help widget stops loading, checkout breaks, and the header gets ripped out under pressure. Report-only mode exists specifically so that never has to happen.

Most of your reports are noise. That is fine, once you know which part

Turn on reporting for the first time and the volume can be alarming. The overwhelming majority of it will have nothing to do with your site being attacked.

Dropbox's engineering team called browser extensions "the biggest source of noise" in their own CSP reports. Extensions inject scripts, fonts, iframes and tracking pixels into pages they have no business modifying, and when a site's CSP blocks that injection, the browser dutifully reports it, even though nothing is actually wrong. Troy Hunt documented a concrete case on Have I Been Pwned, where the Honey coupon extension was quietly loading a font from its own CDN on every page, generating violation reports for something no site operator could have anticipated or fixed. Once Hunt flagged it, Honey simply stopped doing it.

A few filtering rules deal with most of this noise before it reaches a human:

  • Ignore blocked URIs on schemes you never use, such as chrome-extension:, safari-extension:, moz-extension:, file: or resource:. Legitimate content on your site never comes from these.
  • Ignore known extension and adware hosts, for example known tracker or toolbar domains, provided you confirm you genuinely never load anything from them yourself.
  • Treat a violated directive containing a scheme or port your policy never specifies (http: inside a policy that only ever states https:, for instance) as a sign of local tampering rather than a real issue on your site.

What is left after that filtering is where the signal lives: repeated reports naming an external domain you do not recognise, attempts to run inline scripts or eval() on pages that should never need them, or a sudden burst of violations from a single policy that was stable for months. Those patterns are worth investigating as a possible injection attempt, not dismissing as background noise.

Where browser support stands right now

The Reporting-Endpoints header itself is well established: MDN marks it Baseline 2024, "Newly available", working across current browsers since September 2024. Getting an actual CSP violation report delivered through report-to in every major browser took longer, because Firefox only added Reporting API support for CSP violations in Firefox 149, released in March 2026. With that gap closed, MDN now marks the report-to directive itself as Baseline 2026, "Newly available": current versions of Chrome, Edge, Firefox and Safari all support it. For years report-to reporting was effectively Chromium-only, with Safari catching up earlier via its own long-standing Reporting API support, and anyone wanting CSP reports from Firefox users had no real option beyond the older report-uri directive.

This still leaves two practical realities for anyone running reporting today. First, "newly available" means older browser versions, and any visitor who hasn't updated in a while, will not honour report-to at all, which is why sending report-uri alongside it remains the safe default rather than a legacy habit to drop immediately. Second, the older Report-To header is deprecated and Chromium-only, and should not be confused with the Reporting-Endpoints header or the report-to directive that replaced it. All three use nearly the same word, and mixing them up is the most common reason reports silently stop arriving.

It is worth watching how organisations with enormous, highly sensitive surfaces are using CSP reporting in practice. Microsoft, for instance, is enforcing a strict Content-Security-Policy on Entra ID sign-in pages through October 2026, allowing scripts only from trusted Microsoft CDN domains to stop browser extensions and injection tools tampering with the login flow. A deployment at that scale, on a page that cannot afford to break, is exactly the kind of rollout that leans on reporting data first and enforcement second.

A practical checklist

  • Send Reporting-Endpoints on every response that might generate a report, naming at least one CSP endpoint
  • Add report-to to your CSP header, referencing a name defined in Reporting-Endpoints
  • Keep report-uri alongside it for older browsers, pointed at the same collection endpoint
  • Start any new or changed policy on Content-Security-Policy-Report-Only before enforcing it
  • Filter out known noise (extension schemes, adware hosts, impossible violated directives) before anyone reviews reports by hand
  • Set an alert on sudden spikes or new, unrecognised blocked domains rather than relying on someone reading every report
  • Only drop the legacy Report-To header once you have confirmed reports are arriving via Reporting-Endpoints, and keep it if you rely on Network Error Logging
  • Move from report-only to enforced gradually, starting with low-risk, low-traffic sections

CSP reporting is not a one-off setup task. Policies drift as new scripts, CDNs and features get added, and extensions or attackers find new ways to probe what is actually allowed. Treat the report stream the same way you would treat any other security telemetry: tuned to cut the noise, watched continuously, and fed back into the policy itself.