🇪🇸 Cambiar a la versión en español: Generador y Auditor Privado CSP
Build and security-audit your Content-Security-Policy (CSP Level 3) HTTP header 100% locally inside your browser to stop XSS, card skimmers (like OPTIMJACK), and silent browser data exfiltration—exporting directly to NGINX, Apache, or HTML.
CSP Level 3 Evaluation & Official Specs
Under the W3C Content Security Policy Level 3 specification and MDN Web Docs CSP guide, browsers enforce fetch and execution allowlists per resource type:
Effective Policy = default-src ∩ explicit directives (script-src, connect-src, frame-src, object-src)
Even if a third-party analytics or A/B CDN script allowed in script-src gets hijacked upstream, locking connect-src blocks rogue fetch() / beacon exfiltration to attacker domains.
High-Impact CSP Directives Against XSS & Card Skimmers
| Directive | Threat Mitigated | Common Misconfiguration |
|---|---|---|
script-src | Inline XSS payloads & unauthorized script hosts | Shipping 'unsafe-inline' or broad https: allowlists |
connect-src | Skimmer beacons over fetch(), XHR & WebSockets | Omitting it with permissive default-src |
object-src 'none' | Legacy <object> & Flash-era plugin vectors | Leaving fallback open to default wildcards |
frame-ancestors 'none' | Cross-origin framing & UI redressing | Using <meta> CSP (ignores frame-ancestors) |
Frequently Asked Questions
How do you roll out strict CSP safely without breaking checkout?
Deploy Content-Security-Policy-Report-Only headers first alongside telemetry logging so you capture legitimate dependencies before switching on enforcement.
Why shouldn't production apps rely on <meta> CSP tags?
Per W3C rules, frame-ancestors, report-uri, and sandbox directives are ignored inside HTML meta tags and must be served over HTTP headers.