HTTP CORS & Content-Security-Policy (CSP) Security Auditor
Paste HTTP response headers (Access-Control-*, Content-Security-Policy, HSTS, X-Frame-Options) to catch unsafe-inline XSS bypasses, wildcard credential leaks, and missing security headers.
Input & Options
Local JS Execution
Parsed Output & Diagnostics
Ready
Status
...
Generated Output
Critical Response Header Benchmarks
| Header | Strict Setting | Common Misconfiguration |
|---|---|---|
| Access-Control-Allow-Origin | Exact origin allowlist + Vary: Origin | * combined with Allow-Credentials: true |
| Content-Security-Policy | object-src 'none'; script-src 'self' or nonce | 'unsafe-inline', 'unsafe-eval', or missing frame-ancestors |
| Strict-Transport-Security | max-age >= 31536000 (1 year) | Short max-age or omitted on HTTPS origins |
| X-Content-Type-Options | nosniff | Omitted, allowing MIME confusion on uploads |
Parser Methodology & Privacy Guarantees
Parses case-insensitive HTTP header lines, splits semicolon-delimited CSP directives, checks CORS origin/credential combinations per the Fetch spec, and calculates an overall Header Hygiene Score.
- Flags invalid/dangerous Fetch spec conflicts (`Access-Control-Allow-Origin: *` + `Access-Control-Allow-Credentials: true`).
- Inspects CSP directives for `'unsafe-inline'`, `'unsafe-eval'`, wildcard `*` script sources, and missing `object-src 'none'` / `frame-ancestors`.
- Audits complementary transport & MIME hardening headers (HSTS, nosniff, X-Frame-Options, Referrer-Policy).
Scope & limitations: Static header inspection checks directive strength; runtime script nonces must still be cryptographically random per response.
Frequently Asked Questions
Why do browsers block Access-Control-Allow-Origin: * with Allow-Credentials: true?
The Fetch specification prohibits wildcard credentialed requests so malicious sites cannot read authenticated responses using a user's cookies. You must echo a validated origin allowlist and set Vary: Origin.
What does 'unsafe-inline' in script-src weaken?
It allows attackers who inject any HTML/inline <script> attribute via XSS to execute arbitrary JavaScript, neutralizing CSP's primary XSS defense.
Is X-Frame-Options still needed if CSP frame-ancestors is set?
Modern browsers prioritize CSP frame-ancestors, while adding X-Frame-Options: DENY or SAMEORIGIN ensures backward compatibility with legacy clients.