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-Onlyfirst. - Send both
report-uriandreport-towhile clients migrate. blocked-urimay be coarsened to an origin or a token likeinline/eval.dispositiondistinguishes anenforceblock from areport(report-only).