webzod
account

Set object-src to 'none' on nginx

headers.csp.object_src · effort: minutes

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

  1. Stage 1: check for object or embed tags on your pages (PDF viewers use them).
  2. Stage 2: append ; object-src 'none' to the value of the add_header Content-Security-Policy line, run sudo nginx -t and reload.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.