Set object-src to 'none'
Why it matters
Without a restrictive object-src, object and embed tags can load content from any source. Hardly any site still needs plugins, so blocking them is usually free.
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
- Stage 1: check whether any page uses object or embed tags (for example to show a PDF); those stop working with 'none'. Use an iframe or a link for PDFs instead.
- Stage 2: add object-src 'none' to the enforced Content-Security-Policy.
http
Content-Security-Policy: <your current policy>; object-src 'none' Related
- Reported by the Content-Security-Policy check
- Add a Content-Security-Policy
- Enforce the report-only Content-Security-Policy
- Send the Content-Security-Policy as an HTTP header
- Restrict where scripts can load from
- Replace 'unsafe-inline' scripts with nonces or hashes
- Remove 'unsafe-eval' from script-src
- Remove wildcard sources from script-src
- Add base-uri to the Content-Security-Policy
- Reduce reliance on inline styles
- Fix the Content-Security-Policy syntax
Scan your domain to see whether this applies to you.