Production Source Map Exposure Checker
Verify that your production build does not ship publicly downloadable .js.map files that let anyone reconstruct your original TypeScript source tree and internal logic.
01 · Exact Passive Checks
What LeakRay inspects on your live URL
| Rule ID & Check | What It Inspects | Why It's Passive & Safe |
|---|---|---|
exposed-sourcemapsPublic .js.map & sourceMappingURL Detection | Inspects first-party JavaScript bundles for SourceMap headers and sourceMappingURL comments, then verifies whether the referenced .map file is publicly served with valid source map JSON. | Checks only source map URLs referenced by your own public scripts under strict size and SSRF caps. |
secret-private-keysSecrets Inside Client JavaScript Bundles | Scans fetched first-party JS assets for accidental hardcoded private keys or service tokens before they leak through bundles or maps. | Matches are redacted in memory before storage and never tested against third-party APIs. |
nextjs-debug-exposureFramework Debug & Build Metadata Exposure | Checks for exposed Next.js development indicators, trace endpoints, or unredacted stack traces in production responses. | Passive GET/HEAD inspection only. |
security-headers-coreScript & Content-Type Hardening | Verifies X-Content-Type-Options: nosniff and Content-Security-Policy headers alongside bundle delivery. | Reads HTTP response headers passively. |
02 · Vulnerable vs. Fixed
Common production leak pattern and the exact fix
// Vulnerable: Vite / Next.js shipping public source maps in production
// vite.config.ts
export default defineConfig({
build: {
sourcemap: true, // Publishes .js.map files directly to public dist/
},
});// Fixed: Keep source maps private (or hidden for Sentry/error tracking)
// vite.config.ts
export default defineConfig({
build: {
sourcemap: "hidden", // Generates maps for upload without public sourceMappingURL
},
});
// In next.config.ts, keep productionBrowserSourceMaps: false (the default).03 · AI Fix Prompt
Paste into Cursor, Claude Code, Lovable, or Bolt
Disable public production source maps while keeping error monitoring working:
1. Check `next.config.*`, `vite.config.*`, and webpack/build scripts for `productionBrowserSourceMaps: true` or `sourcemap: true`.
2. Switch to `productionBrowserSourceMaps: false` (Next.js) or `sourcemap: "hidden"` / `false` (Vite).
3. If using Sentry or Datadog, upload source maps during CI and delete `.map` files from the deployed public artifact.
4. Verify no `.js.map` files remain accessible in the production build output.04 · Developer FAQ
Frequently asked questions
- Why are public production source maps a security risk?
- Public .js.map files often embed your original unminified TypeScript/JSX files via sourcesContent, revealing internal API routes, business logic, feature flags, developer comments, and occasionally leftover secrets.
- How can I still get readable stack traces in Sentry without public source maps?
- Use hidden source maps (for example sourcemap: 'hidden' in Vite or Sentry's Next.js plugin with deleteSourcemapsAfterUpload: true) so maps are uploaded privately to your error tracker and never served to browsers.
- Does LeakRay download my entire codebase if a source map is exposed?
- No. LeakRay only checks whether the referenced .js.map endpoint returns valid source map metadata (version and sources fields) under a strict size cap, flags the URL, and discards the body.
- Are source maps ever okay to leave public?
- For open-source web apps where the entire frontend code is already public on GitHub, public source maps are a low risk. For closed-source SaaS products, keeping them private is standard defense in depth.
More Passive Scanners
Explore related LeakRay checks
Supabase RLS & Key Exposure Checker
Passively scan your live app for leaked Supabase service_role keys, exposed PostgREST schemas, and missing RLS signals. Zero signup, <15s.
Open scanner Next.js · App Router & Pages Router · Passive AuditNext.js Production Security Scanner
Audit live Next.js apps for __NEXT_DATA__ secret leaks, debug stack traces, exposed source maps, .env files, and missing security headers.
Open scanner JS Bundles · Entropy + Context Validation · Passive AuditLeaked API Key & Frontend Secret Scanner
Scan your live HTML and JavaScript bundles for leaked Stripe, OpenAI, Anthropic, Gemini, AWS, and GitHub keys—without false-positive noise.
Open scanner Server Config · Dotfiles · Passive AuditExposed .env & .git File Checker
Check if your live website publicly exposes /.env, /.git/HEAD, or backup config files. Passive read-only URL scan with instant fixes. Zero signup.
Open scanner Firebase · Firestore · Passive AuditFirebase & Firestore Security Scanner
Passively audit live Firebase apps for leaked Admin SDK keys, exposed .env files, public source maps, and weak security headers without public apiKey noise.
Open scanner Cursor · Lovable · Bolt · v0 · Passive AuditSecurity Scanner for Vibe-Coded Apps
Free pre-launch security check for AI-built apps from Cursor, Claude Code, Lovable, Bolt, and v0. Catch leaked keys, open files, and missing headers.
Open scanner Headers · CORS · Cookies · Passive AuditHTTP Security Headers & CORS Checker
Check HSTS, CSP, SRI, COOP, CORS credential reflection, and cookie flags — plus JS secret & file checks that header-only scanners miss. Zero signup.
Open scanner