CSPRules
CSP Rules

Content Security Policy: how it works, where it fails, and how to keep it under control.

A Content Security Policy tells the browser which origins a page may load code from, and refuses everything else.1 CSP Rules covers the specification, the incidents that test it, and the practice of maintaining a policy over time. Every claim is cited.

Content-Security-Policy:
  default-src 'self';
  script-src 'self' cdn.optimizely.com *.cloudfront.net static.hotjar.com; # owner: unknown · added: unknown · in use: unknown
  connect-src 'self' api.stripe.com;
  report-to csp-endpoint
Product · in development

CSP Ledger

Every source in a Content Security Policy is a trust decision. The header records what is allowed, but not who decided, why, or until when. CSP Ledger keeps that record for each source, tied to the reports that show whether it is still in use.

Provenance

A record per source

Owner, requester, justification, approval, scope and review date for every source and directive.

Evidence

Usage from reports

CSP reports attached to each record show whether a source is used, unused, or suddenly violated.

Control

A change workflow

Sources are requested, reviewed and approved before the header is generated. Risky values are refused at request time.

Response

Known scope on incident

When a vendor is compromised, its pages, owners and directives are already listed.

Why policies fail

94.72%
of 26,011 distinct real-world policies could be bypassed, in a 2016 study of 1.68 million hosts. Unreviewed allowlist entries were the most common cause.2
PCI 6.4.3
PCI DSS v4.0.1 requires an inventory of payment-page scripts with a written justification and an authorisation for each. Mandatory since 31 March 2025.3
~178
organisations served attacker code through a trusted vendor's CDN on 16 November 2026. Each had to establish, under time pressure, which pages trusted that vendor.4
16 NOV 2026

OPTIMJACK. Malicious JavaScript was served from Optimizely's CDN to visitors of approximately 178 organisations.4,5 Incident analysis. Earlier incidents with the same pattern. Test a policy against it.

Reference

References

  1. [1]
    Content Security Policy Level 3. W3C, Web Application Security Working Group. Working Draft. The normative definition of directives, source matching and fallback.
  2. [2]
    CSP Is Dead, Long Live CSP! On the Insecurity of Whitelists and the Future of Content Security Policy. Weichselbaum, Spagnuolo, Lekies, Janc. ACM CCS, 2016. Analysis of 26,011 unique policies from 1,680,867 hosts.
  3. [3]
    PCI DSS v4.0.1, Requirements 6.4.3 and 11.6.1. PCI Security Standards Council. Payment-page script inventory, authorization and tamper detection. Mandatory from 31 March 2025.
  4. [4]
    Optimizely supply-chain attack hits at least 178 organisations. BreachHistory, Nov 2026. Timeline, indicators of compromise and remediation steps. Cites Report URI's snippet scan.
  5. [5]
    CNN, Zoom, Fox News served visitors a crypto-stealing skimmer. Amirul Cyber, 16 Nov 2026. Original disclosure. Names the campaign OPTIMJACK.