Content-Security-Policy Header Explained

What the HTTP Content-Security-Policy header does and when it's used.

Published October 16, 2026

The Content-Security-Policy header restricts which sources of content (scripts, styles, images) a page is allowed to load.

Key points

  • A key defense against XSS attacks by blocking unauthorized inline or external scripts
More HTTP articles