CSP Violation Report Fields

All CSP violation report JSON fields with Report-To and Reporting API context.

Reference for Content Security Policy violation report fields from both the legacy csp-report mechanism and the modern Reporting API (report-to), with each field's meaning and source.

What is a CSP violation report?

When a Content Security Policy blocks a resource or inline script, the browser can POST a JSON report describing the violation to a configured endpoint. It records which directive was violated, the blocked URI, and where in the page the offending content lived, so developers can audit and tighten their policy.

CSP violation report fields

When a Content Security Policy blocks something, the browser can send a JSON violation report to an endpoint. Two formats exist: the legacy report-uri (csp-report) body and the modern Reporting API (report-to). This reference lists every field in both, with meaning and source, plus a live filter.

How it works

A page declares where to send reports, then the browser POSTs JSON on a violation. The legacy format wraps fields in a csp-report object:

{
  "csp-report": {
    "document-uri": "https://app.example/page",
    "violated-directive": "script-src 'self'",
    "effective-directive": "script-src-elem",
    "blocked-uri": "https://evil.example/x.js",
    "disposition": "enforce",
    "status-code": 200
  }
}

The Reporting API sends a report with type: "csp-violation" and a body object whose keys are camelCase (documentURL, blockedURL, effectiveDirective). The fields carry the same meaning across both formats.

Tips and notes

  • Trial new policies with Content-Security-Policy-Report-Only first.
  • Send both report-uri and report-to while clients migrate.
  • blocked-uri may be coarsened to an origin or a token like inline/eval.
  • disposition distinguishes an enforce block from a report (report-only).