webzod
account

Add base-uri to the Content-Security-Policy on Cloudflare

headers.csp.base_uri · effort: minutes

Why it matters

An injected base tag can make every relative script URL on the page load from an attacker's server. base-uri 'self' (or 'none') stops that and almost never breaks anything.

The fix

  1. Open Rules, Overview, edit the Response Header Transform Rule that sets Content-Security-Policy and append ; base-uri 'self' to its value. If the origin sets the policy, change it there.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.