webzod
account

Restrict where scripts can load from on Apache

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 the line below next to your existing CSP and reload; check the developer console.
  2. Stage 2: merge the directives into the enforced Content-Security-Policy and remove the report-only line.
apache
Header always set Content-Security-Policy-Report-Only "script-src 'self'; object-src 'none'; base-uri 'self'"

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.