HTTP headers
Content-Security-Policy HTTP Header Meaning
Content-Security-Policy restricts where page resources can load from.
Meaning
The server is sending browser-enforced rules for scripts, styles, images, frames, and other resource types.
Where it appears
Web apps send it to reduce script injection, clickjacking, mixed-content, and data exfiltration risks.
What to check
Check blocked resource reports, nonce or hash strategy, frame rules, and whether the policy is too broad.
Example
Content-Security-Policy: default-src https:; img-src https: data:Common values and directives
default-srcdefault-src 'self'Fallback source list for fetch directives that are not set more specifically.script-srcscript-src 'self' https://cdn.exampleControls where JavaScript can load from and which inline script patterns may run.style-srcstyle-src 'self' 'unsafe-inline'Controls where CSS can load from and how inline styles are handled.img-srcimg-src https: data:Controls where images can load from.connect-srcconnect-src 'self' https://api.exampleControls URLs used by fetch, XHR, WebSocket, EventSource, and similar APIs.font-srcfont-src https://fonts.exampleControls where fonts can load from.frame-srcframe-src 'self'Controls which URLs this page may load into frames.frame-ancestorsframe-ancestors 'none'Controls which parent pages can embed this page in a frame.base-uribase-uri 'self'Restricts which URLs may be used in a base element.object-srcobject-src 'none'Controls plugin-style object, embed, and applet resources.report-toreport-to defaultNames a reporting endpoint group for policy violation reports.report-urireport-uri https://example.com/csp-reportSends policy violation reports to a URL; newer policies often use report-to.