CSP field guides
From inheritance and nonce to deploy formats, ordered by what prevents real incidents.
- CSP directive structure and default-src inheritanceHow a policy string splits into directives and sources, which directives inherit default-src, and what an empty value actually does.
- nonce, hash and strict-dynamic: allowing inline scripts safelyHow nonce and hash let you drop unsafe-inline without breaking inline scripts, how strict-dynamic disables the host allowlist, and the correct combinations.
- Nine CSP bypass patterns and the attacks they enableunsafe-inline, wildcards, data:, blob:, http:, missing base-uri, sandbox escapes and nonce-less strict-dynamic: the combinations that defeat a policy.
- Rolling out a CSP with Report-Only and violation reportsHow Content-Security-Policy-Report-Only behaves, report-uri versus report-to, designing a collector, and the switch to enforcing.
- CSP deployment: _headers, Nginx, Apache and meta tagsHow to ship a CSP in Cloudflare Pages _headers, Nginx add_header, Apache Header always set and an HTML meta tag, and the traps in each.
0 bytes of your input sent to a server (advertising and affiliate widgets excluded)