Analisador de CSP
Analyze Content-Security-Policy (CSP) and Content-Security-Policy-Report-Only for any URL. Detect risky directives (unsafe-inline, wildcards), missing nonce/hash strategies, deprecated patterns, and provide actionable recommendations to harden XSS defenses. Supports redirects, raw header inspection, filtering, findings, and JSON/PDF export.
Features
- Detect and explain Content-Security-Policy and Content-Security-Policy-Report-Only headers.
- Flag common CSP footguns: unsafe-inline, unsafe-eval, broad wildcards, and overly permissive sources.
- Guidance for safer script/style execution via nonce and hash-based strategies.
- Identify missing directives that often matter in real-world hardening (e.g., frame-ancestors, object-src, base-uri).
- Report-Only insights: understand what would be blocked and how to roll out CSP without breaking production.
- Follow redirects (up to 10) to analyze the final response policy that browsers apply.
- Raw headers view for exact server output and debugging.
- Findings + score card with "only problems" filtering.
- Export analysis to JSON or PDF for audits, tickets, and security reviews.
- Includes deprecated header awareness to catch legacy policies and migration needs.
🧭 How to use for csp-analyzer
Enter the URL to analyze
Paste the page URL you want to check (often your homepage or app shell).
Enable redirect following if needed
Keep "Follow Redirects" enabled so the analyzer reaches the final HTTPS/www/locale destination where the real CSP is returned.
Review the score card and findings
Start with findings to spot critical risks (unsafe-inline, wildcards, missing restrictions) and understand which directives are driving the score.
Inspect raw headers when debugging
Turn on "Show Raw Headers" to verify exact header names/values (useful if multiple CSP headers are present or a proxy/CDN modifies them).
Export a report for your security workflow
Download JSON for automation or PDF for security audits and engineering tickets.
Technical specs
Request model
This tool performs a URL header inspection and focuses on security header analysis, including CSP and report-only policies.
| Setting | Behavior | Default |
|---|---|---|
| Follow Redirects | Follows the redirect chain to analyze the effective policy returned by the final URL | Enabled |
| Max Redirects | Redirect cap to prevent loops | 10 |
| Timeout | Request timeout limit | 15000 ms |
| User-Agent | Identifies the request user agent | Encode64Bot/1.0 (+https://encode64.com) |
| Private networks | Blocks access to private network ranges for safety | Disabled (private networks not allowed) |
CSP headers inspected
The analyzer checks for both enforcing and non-enforcing policies and surfaces them in a readable form.
| Header | Meaning |
|---|---|
| Content-Security-Policy | Enforced policy applied by the browser |
| Content-Security-Policy-Report-Only | Non-blocking policy that reports violations (useful for rollout and tuning) |
What the analysis looks for
Findings are based on practical CSP hardening checks and common deployment mistakes.
| Area | Examples of findings |
|---|---|
| Script policy strength | unsafe-inline / unsafe-eval usage, wildcard sources, missing nonce/hash strategy |
| Style policy strength | unsafe-inline styles, overly broad sources, missing migration path to nonces/hashes where feasible |
| Framing and clickjacking resistance | Missing or weak frame restrictions (often via frame-ancestors) |
| Legacy / deprecated patterns | Old directives or patterns that should be modernized |
| Rollout readiness | Report-Only presence and reporting endpoints visibility |
Command line
Use these commands to inspect CSP headers quickly. They're useful for validating what the analyzer reports.
macOS / Linux
Fetch response headers (look for CSP)
curl -I https://example.comInspect Content-Security-Policy and Content-Security-Policy-Report-Only in the response headers.
Follow redirects while checking headers
curl -IL https://example.comEnsures you see CSP headers from the final destination (HTTPS, www, app shell route).
Show CSP headers only (case-insensitive match)
curl -I https://example.com | grep -i "content-security-policy"Quickly isolates CSP and report-only headers from the full header set.
Windows (PowerShell)
Inspect CSP headers
$r = Invoke-WebRequest -Uri https://example.com -Method Head; $r.Headers['Content-Security-Policy']; $r.Headers['Content-Security-Policy-Report-Only']Displays enforcing and report-only CSP headers if present.
Use cases
Harden a site against XSS
Use CSP to reduce the impact of injection vulnerabilities by restricting where scripts/styles can load from and how inline code is handled.
- Identify unsafe-inline/unsafe-eval and plan a migration to nonces/hashes
- Restrict script-src/style-src sources to trusted origins
- Add missing defensive directives (base-uri, object-src, frame-ancestors)
Roll out CSP safely with Report-Only
Introduce CSP gradually without breaking production by starting with Content-Security-Policy-Report-Only and iterating on violations.
- Detect report-only policy presence
- Understand what would be blocked before enforcing
- Export a report for your rollout plan and tickets
Debug broken scripts, iframes, or third-party widgets
Overly strict CSP can block analytics, embeds, or API connections. Use the analyzer to see what the policy permits and where you may need explicit sources.
- Confirm allowed script/img/connect/frame sources
- Detect overbroad wildcards added as a quick fix
- Replace broad allowances with targeted domains
Security review / compliance evidence
Generate a consistent report of current CSP posture for security reviews, client questionnaires, or internal compliance.
- Download JSON for tracking changes over time
- Download PDF for audit artifacts and sharing
❓ Frequently Asked Questions
❓What is CSP and what does it protect against?
❓What's the difference between CSP and CSP Report-Only?
❓Why is unsafe-inline considered dangerous?
❓Do I need nonces or hashes?
❓Can a CDN or proxy change my CSP header?
❓Is CSP a replacement for fixing XSS bugs?
❓Is it safe to paste URLs here?
Pro Tips
Start with Content-Security-Policy-Report-Only, collect violations, then tighten and enforce. CSP is iterative for real apps.
Replace unsafe-inline with a nonce or hash strategy. Keep policies explicit and minimal.
Add frame-ancestors to reduce clickjacking risk and avoid relying only on legacy headers.
Avoid broad wildcards as a quick fix. Prefer targeted domains for scripts/images/connect and review third-party needs.
Export a JSON report and track CSP changes in CI so you catch regressions when headers are modified by CDN/app updates.
Additional Resources
Other Tools
- Embelezador CSS
- Embelezador HTML
- Embelezador Javascript
- Embelezador PHP
- Seletor de Cores
- Extrator de Sprites
- Codificador Binário Base32
- Decodificador Base32
- Codificador Base32
- Codificador Binário Base58
- Decodificador Base58
- Codificador Base58
- Codificador Binário Base62
- Decodificador Base62
- Codificador Base62
- Codificador Binário Base64
- Decodificador Base64
- Codificador Base64
- Codificador Binário Hexadecimal
- Decodificador Hexadecimal
- Codificador Hexadecimal
- Formatador Csharp
- Formatador CSV
- Dockerfile Formatter
- Formatador Elm
- Formatador ENV
- Formatador Go
- Formatador GraphQL
- Formatador HCL
- Formatador INI
- Formatador JSON
- Formatador LaTeX
- Formatador Markdown
- Formatador Objective-C
- Php Formatter
- Formatador Proto
- Formatador Python
- Formatador Ruby
- Formatador Rust
- Formatador Scala
- Formatador de Script Shell
- Formatador SQL
- Formatador SVG
- Formatador Swift
- Formatador TOML
- Typescript Formatter
- Formatador XML
- Formatador YAML
- Formatador Yarn
- Minificador CSS
- Html Minifier
- Javascript Minifier
- Minificador JSON
- Minificador XML
- Cache Headers Analyzer
- Cors Checker
- Dns Records Lookup
- Visualizador de Cabeçalhos HTTP
- Http Status Checker
- Open Graph Meta Checker
- Redirect Chain Viewer
- Robots Txt Tester
- Security Headers Checker
- Security Txt Checker
- Sitemap Url Inspector
- Tls Certificate Checker
- PDF para Texto
- Testador de Regex
- Verificador de Classificação SERP
- Consulta Whois