Microdeck.tools 100% In-Browser

CSP Auditor & HTTP Security Headers Builder

New

Harden web applications against XSS, clickjacking, and MIME sniffing before going live. Paste an existing `Content-Security-Policy` header to score severity (`Strong` / `Moderate` / `Weak`) and highlight missing directives (`object-src`, `base-uri`, `frame-ancestors`), then build drop-in Cloudflare Pages `_headers` and Nginx `add_header` security blocks.

100% In-Browser No Server Storage Instant Results

1. Audit Existing Content-Security-Policy Header

Grade: Weak
Missing recommended hardening directives: frame-ancestors
default-srcok

Fallback policy when more specific fetch directives are omitted.

script-srchigh

Restricts where JavaScript can load and execute. Allows 'unsafe-inline' scripts, weakening XSS protection unless paired with nonces/hashes.

img-srcok

Restricts image origins (often includes data: or blob:).

object-srcok

Restricts legacy plugins (<object>, <embed>). Recommended: none.

base-uriok

Prevents base-tag hijacking of relative URLs.

2. Build Cloudflare `_headers` & Nginx Security Policy

Cloudflare Pages / Netlify `_headers`
Nginx `add_header` Snippet

Did this tool save you time? Help keep Microdeck free and maintained. Completely optional · From $3.

How It Works Under the Hood

The auditor parses semicolon-separated CSP directives, flags high-risk tokens (`'unsafe-eval'`, `'unsafe-inline'` in scripts, wildcard `*`, or broad `http:` schemes), checks whether critical defenses (`default-src`, `script-src`, `object-src`, `frame-ancestors`, `base-uri`) are present, and compiles clean `_headers` + Nginx configurations.

Step-by-Step Instructions

1

Paste your existing `Content-Security-Policy` header string into Section 1 to audit warnings and grade (`Strong`, `Moderate`, `Weak`).

2

Review any missing hardening directives listed below the policy box.

3

Customize directive sources, `X-Frame-Options` (`DENY` vs `SAMEORIGIN`), and HSTS preload in Section 2.

4

Copy the generated Cloudflare Pages/Netlify `_headers` block or Nginx `add_header` rules.

Key Features & Performance

  • Flags dangerous `'unsafe-eval'`, script `'unsafe-inline'`, and wildcard `*` CSP exposures instantly
  • Detects missing foundational defenses (`object-src 'none'`, `base-uri 'self'`, `frame-ancestors`)
  • Generates both Cloudflare Pages/Netlify `public/_headers` syntax and Nginx `add_header ... always;` snippets
  • Includes `X-Content-Type-Options: nosniff`, `Referrer-Policy`, `Permissions-Policy`, and optional HSTS Preload
  • 100% browser-local: safe for internal staging URLs and private API domain lists

Methodology, Formulas & Technical Standards

Scoring classifies high-severity execution bypasses (`'unsafe-eval'`, script `'unsafe-inline'`, `3+` missing critical directives) as `Weak`, warning-level exposures or minor gaps as `Moderate`, and locked-down self/allowlist policies as `Strong`.

Common Real-World Use Cases

  • Eliminating SecurityHeaders.com / Mozilla Observatory grade deductions before launching a new SaaS site
  • Creating a `public/_headers` file for Cloudflare Pages / Astro static sites
  • Locking down iframe embedding via `frame-ancestors 'none'` and `X-Frame-Options: DENY`
  • Tightening `connect-src` endpoints to permit only first-party and authorized API hosts

Worked Examples & Edge Cases

Flagging Script Unsafe-Inline

Input
default-src 'self'; script-src 'self' 'unsafe-inline'
Output
Grade: Weak | Missing: object-src, frame-ancestors, base-uri

Explains why `unsafe-inline` inside `script-src` permits injected inline scripts.

Cloudflare Pages _headers Output

Input
allowFrames: DENY, enableHsts: true
Output
/*
  Content-Security-Policy: ...
  X-Frame-Options: DENY
  Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

Drop directly into `public/_headers` before `astro build`.

Limitations, Scope & Accuracy Notes

  • • HSTS `preload` (`max-age=31536000; includeSubDomains; preload`) enforces HTTPS across all subdomains — test carefully before enabling on domains with plain HTTP subdomains.
  • • Legacy static sites or third-party analytics embeds may require nonces or explicit domain entries inside `script-src` rather than strict `'self'`.

Local Browser Processing & Privacy

Traditional web converters upload your documents, snippets, or media files to remote servers. CSP Auditor & HTTP Security Headers Builder runs inside your browser tab:

Processed in This Tab

Your input text and files are processed locally without uploading payloads to a processing server.

No Tool Payload Logging

Microdeck does not log or store the files or inputs you paste into tool workspaces (normal static hosting/CDN requests still load page assets).

Tab Memory Lifecycle

Working outputs stay in your browser tab and are released when you reset the tool or close the tab.

Frequently Asked Questions

Why does `'unsafe-inline'` inside `style-src` warn differently from `script-src`?

Inline `<script>` execution poses critical arbitrary XSS code-execution risk, whereas `style-src` inline styles often accompany Tailwind/UI libraries and represent a moderate/context-dependent risk.

Why are `object-src 'none'` and `base-uri 'self'` checked?

Even with strict `script-src`, omitting `base-uri` lets attackers rewrite relative script URLs via `<base>` injection, and omitting `object-src` risks legacy plugin execution.

Where do I place the Cloudflare `_headers` output?

Save it as `public/_headers` in Astro/Vite/Next static output so it lands at `dist/_headers` for Cloudflare Pages or Assets.

Does this probe my live domain over HTTP?

No. Auditing happens strictly on the policy string you paste inside your browser.

Explore Related Micro-Tools

Support Microdeck

Completely optional · From $3 · No account required

Choose an amount (USD):Selected:$5

Minimum support amount is $3 USD.

Completely optional · From $3 · Checkout opens on Gumroad.