Skip to main content
SiteScan.top

Content-Security-Policy (CSP) header

The list of sources a page may load scripts, styles and frames from. It is the one header that limits what an injected script can do — unless its script sources allow unsafe-inline, which hands that back.

Content-Security-Policy (CSP) lists the sources a page is allowed to load scripts, styles, images, frames and other resources from. If an attacker finds a way to inject HTML, the browser still refuses to run scripts that the policy does not allow. It is the one header that directly limits the damage of cross-site scripting (XSS).

How SiteScan grades it

Separate findings point out a policy without default-src, object-src, base-uri or frame-ancestors, and a * source for scripts. Inline styles are reported but do not lower the grade.

How to start

A solid base: default-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self', then add the external hosts your pages really use. Deploy it first as Report-Only, watch the reports for a week, then switch to the enforcing header. Replace inline <script> blocks with files or add nonces. More in the guide to security headers.

See this check on your own site

Run a free scan: the report shows this row for your domain along with the other checks of the site audit.

More in “Security headers”

What SiteScan checks

TLS certificate

Domain registration

Indexing

Addresses & redirects

Security headers

Delivery & reputation

Internal links

Exposure

Well-known files

DNS & email

Privacy & consent

Core Web Vitals

Technology