webzod
account

Restrict where scripts can load from on Cloudflare

headers.csp.script_src_missing · effort: a project

Why it matters

The policy sets neither script-src nor default-src, so it does nothing against injected scripts, the main thing a CSP is for. Add a script-src that lists only your own origin and the services you use, or that uses nonces.

Staged change. Do this in stages and check each one before the next, so a mistake does not break your site or your mail.

The fix

  1. Stage 1: add a Response Header Transform Rule (Rules, Overview, Create rule) with Set static, header Content-Security-Policy-Report-Only, value script-src 'self'; object-src 'none'; base-uri 'self'. It does not touch your enforced policy.
  2. Stage 2: once only legitimate sources remain, add the directives to wherever your enforced Content-Security-Policy is set and delete the report-only rule.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.