Яндекс.Метрика

Content security policy checker

Check if a website returns a Content-Security-Policy header.

0 of 0 ratings

What this checker does

The Content Security Policy checker requests a URL and reports whether the response includes a Content-Security-Policy header. CSP is a browser security mechanism that restricts which resources a page can load and execute.

The tool tells you whether the header is present. It does not evaluate whether the policy is strong, complete, or correctly configured.

What CSP does

A Content-Security-Policy header lets a site declare approved sources for scripts, styles, images, fonts, frames, and other resources. When configured well, it reduces the impact of certain attacks, particularly cross-site scripting, by limiting what injected code can do.

CSP is defense in depth. It does not replace input validation, output encoding, or other security practices, but it adds a layer that can make exploitation harder.

Reading the result

If the header is present, the tool reports it. The value may contain multiple directives separated by semicolons, such as default-src 'self' or script-src 'self' https://cdn.example.com.

If the header is absent, the page has no CSP protection. That does not mean the site is insecure, but it does mean one available layer is missing.

A present header is not automatically a good policy. A very permissive policy, such as one allowing 'unsafe-inline' and broad sources, provides less protection. Evaluating policy quality requires understanding the site’s resource needs.

Practical guidance

  • Start with reporting: use Content-Security-Policy-Report-Only to observe violations without blocking resources.
  • Restrict sources: allow only the domains and inline hashes or nonces your site actually needs.
  • Plan for inline scripts and styles: strict policies require nonces, hashes, or moving code to external files.
  • Review regularly: policies need updates when third-party services change.

Limitations

The checker reports the header for the URL you provide. It does not test the policy in a browser, verify that all resources comply, or check other security headers. It also does not assess whether the policy matches the site’s functionality.

Use the result as a starting point for a broader security header review.

Similar tools

HTTP headers lookup

Inspect the HTTP response headers returned by a URL for a standard GET request.

8
HSTS checker

Check whether a site enforces HTTPS with the HTTP Strict Transport Security header.

11
Referrer policy checker

Check if a website returns a Referrer-Policy header and display its value.

5

Popular tools