Security Tools

CSP Header Checker — Content-Security-Policy Parse & Grade

Parse and grade Content-Security-Policy directives with unsafe-* and wildcard issue detection

How to Use This Tool

  1. Paste a full URL including https:// scheme.
  2. We fetch the response following redirects with a standard tool user agent.
  3. Content-Security-Policy or Report-Only header value is extracted.
  4. Directive parser splits semicolon-separated policy into name and source lists.
  5. Heuristics flag unsafe-inline, unsafe-eval, wildcards, data:, and missing directives.
  6. Review grade, issues, directives map, and reportOnly status.

About This Tool

Content-Security-Policy is the primary browser mechanism for restricting script, style, and resource loading origins — yet policies vary from strict nonces to permissive wildcard configurations that barely mitigate XSS. VSPIC CSP header checker fetches your URL, extracts Content-Security-Policy or Content-Security-Policy-Report-Only headers, parses directives into structured maps, and assigns letter grades with explicit issues for unsafe-inline, unsafe-eval, data: schemes, wildcard sources, and missing frame-ancestors.

Results include present and reportOnly flags, directives object, boolean flags for key directives, issues array, grade A through F, and summary text. This focused tool does not score HSTS, X-Frame-Options, or Referrer-Policy — use security headers checker for composite header grading across five categories.

Common use cases

  • Check if a VPN or proxy is detected on your connection
  • Validate SSL certificates before launch
  • Scan for email addresses in known breaches

Why use VSPIC for ?

  • Dedicated CSP parse and grade — not diluted across other headers.
  • Directive map with default-src, script-src, frame-ancestors visibility.
  • unsafe-inline and unsafe-eval detection with issue explanations.
  • Wildcard and data: scheme warnings for XSS escalation paths.
  • Report-Only mode detected separately from enforcing policy.
  • Free instant fetch — publicly reachable URLs only.

Why dedicated CSP analysis matters

Composite security header scores award twenty-five points for any CSP presence — whether strict or dangerously permissive. XSS defenders need directive-level critique: does script-src allow unsafe-inline? Are wildcards opening every origin? Does frame-ancestors complement clickjacking controls?

Our CSP header checker exists because policy quality matters more than policy existence. A site with Content-Security-Policy: default-src * may score well on presence-only checkers while offering minimal protection.

Parsing directives into structured maps

CSP headers use semicolon-separated directives with space-separated source lists — script-src 'self' https://cdn.example.com; object-src 'none'. We parse each directive name lowercase into a directives object mapping to token arrays for programmatic review and copy-paste into documentation.

hasDefaultSrc, hasScriptSrc, hasStyleSrc, and hasFrameAncestors booleans summarize coverage. Missing both default-src and script-src triggers an issue because browsers fall back to permissive default behavior for script loading.

unsafe-inline and unsafe-eval risks

unsafe-inline in script-src or style-src allows inline script blocks — the primary XSS injection vector CSP was designed to eliminate. unsafe-eval permits eval() and similar constructs attackers use to execute string payloads. Each triggers dedicated issues and significant grade penalties.

Legacy apps often require unsafe-inline during migration — track issues array as a remediation backlog toward nonce or hash based policies.

Wildcard and data scheme sources

Wildcard * in any directive source list permits loading from arbitrary origins for that resource type — defeating origin restriction purpose. data: URIs in script contexts enable injection via base64 payloads in some browser configurations.

wildcardSources and dataScheme booleans highlight these patterns. Grade deductions reflect severity in our scoring model aligned with common CSP deployment guidance.

frame-ancestors and clickjacking

frame-ancestors replaces X-Frame-Options in modern browsers, specifying which origins may embed your page in iframes. Missing frame-ancestors with no child-src fallback generates an issue — clickjacking protection may rely solely on X-Frame-Options if present.

Pair with clickjacking test when framing policy is security critical. CSP frame-ancestors 'none' is stronger than SAMEORIGIN in multi-origin embedding scenarios.

Report-Only versus enforcing policy

Content-Security-Policy-Report-Only sends violation reports without blocking — useful for staging policy rollouts. reportOnly true in results means only Report-Only header appeared without enforcing CSP.

Production sites should deploy enforcing policies after Report-Only validation. Monitoring report-uri or report-to endpoints catches violations during transition.

Grade A through F interpretation

Grade A requires high heuristic score — typically strict sources without unsafe tokens or wildcards. Grade B and C indicate partial protections with notable gaps. D and F reflect missing core directives or dangerous unsafe tokens.

Grades approximate deployment maturity — not formal penetration test verdicts. Manual review of directives object remains essential for nonce uniqueness and third-party script allowlists.

Relationship to security headers checker

Security headers checker scores five header categories at presence level with composite 0–100 score. CSP header checker dives exclusively into Content-Security-Policy parsing and weakness detection.

Run composite checker for executive dashboards. Run CSP checker when engineers tune script-src during XSS remediation sprints.

Deployment and CDN considerations

CDNs and edge workers inject CSP at different layers — origin versus edge policies may differ. Test the public URL users hit, including www versus apex variants.

Subresource responses carry separate CSP for embedded contexts — this tool analyzes the top-level document response only.

Privacy and responsible use

We fetch publicly reachable URLs you submit with a standard tool user agent. Test only sites you own or are authorized to assess. Fetch results reflect one path at query time.

Copied policy strings may contain internal domain names — sanitize before sharing in public tickets.

Important notes & limitations

  • Grades policy syntax heuristics — not runtime nonce rotation quality.
  • Only checks the URL submitted — not every subresource response.
  • Some hosts return different headers to bots versus browsers.
  • localhost and private URLs are not reachable from our server.
  • Presence of CSP does not guarantee XSS immunity if policies are weak.

Frequently Asked Questions

Yes. VSPIC offers this CSP header checker at no cost with no account required. Results load in real time.

We do not permanently store your queries on our servers. Some tools run entirely in your browser; others fetch public data for the request only.

Yes. Open the page in any modern phone or tablet browser. Results work on Wi‑Fi and mobile data.

No. Grade reflects heuristic policy strictness. Application bugs and misconfigured nonces can still enable XSS.

If only Report-Only CSP is present, we parse it but note policies are not enforcing yet.

Security headers checker scores five headers at presence level. CSP checker parses directive quality and unsafe patterns in depth.

No. Our server must reach the URL from the public internet. localhost and private IPs are blocked.

Yes. unsafe-inline in any directive contributes to issues and grade penalties.

present false with grade F and summary noting absence. Browsers apply no CSP restrictions.

Next step for your check

Continue with security headers checker on VSPIC.

Security Headers Checker

Trusted by Users Who Value Privacy

Always Free

No premium plan ever

100% Private

Files processed in browser

Instant Results

Convert in seconds

Works Everywhere

Any device, any OS