Content-Security-Policy reports

Every page the forge renders carries report-uri /csp-report and report-to csp in its policy, with a Reporting-Endpoints: csp="/csp-report" header. The bare floor policy that securityFloor puts on non-document answers does not name it: the floor also covers an app's proxied responses, and a relative address there would resolve to the app's host, where no report could be counted. When a browser blocks something it posts a report there, so a broken or hostile page is seen, not guessed.

POST /csp-report (src/http/csp_report.ts) takes application/csp-report, application/reports+json or application/json, at most 8 KB, in either the report-uri or the Reporting API shape. Anything else gets a 4xx and nothing is stored. It keeps only the directive, the blocked host (no path, no query string) and the page's path, as one count per UTC hour in csp_violation (its day column holds YYYY-MM-DDTHH), so a window's count holds only reports from the window's whole hours, never a report older than it. That is at most 500 rows a UTC day (the rest fold into one row) and 30 days kept. Anonymous callers are limited to 30 a minute each and 600 a minute per forge. It answers 204.

/settings/security shows one line, "Blocked by the page policy, 7 days", listing counts by directive. When nothing was blocked, the line is not shown. The terminal's Security controls screen (admin only) lists the same weekly counts, one row per directive below the controls, and none when nothing was blocked.

Script errors

The page-view beacon also reports uncaught script errors (error and unhandledrejection) to POST /_script-error (src/http/script_errors.ts), so a page that throws is seen, not guessed (#11447).

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs