KeyDrift
Free scan
← Leak scenarios

Published source maps hand back your original code — secrets included

Deployed .map files reconstruct original sources, env reads included. KeyDrift checks maps too — scan free, no account.

3 min read

Minified output obscures by design; source maps exist to reverse it. Ship both publicly and you have published the original sources — variable names, comments, env reads, everything.

Companion explainer lives on the blog; this page is the checklist.

The thirty-second manual test

Append .map to any served chunk URL. A JSON containing sources with your real filenames means originals are retrievable. Repeat across a few chunks — coverage varies by build config.

What scanners recover from maps

  • Original source trees, sometimes entire repositories of frontend code.
  • Pre-minification literals: env reads, hardcoded fallbacks, commented-out keys.
  • Internal naming that aids further attack mapping.

Fix matrix

  1. Disable production sourcemaps when not needed for error decoding.
  2. When needed (e.g., Sentry), upload privately to the observer and keep them off the CDN.
  3. Scrub-and-emit pipelines if maps must ship: strip env-bearing files from sourcesContent.

Verify

KeyDrift treats maps as part of the served surface — if originals contain secrets, the report shows them with the map file named. Free scan settles current state.

Why this keeps happening industry-wide

It helps to name the economics honestly. Fixing this class of leak costs minutes when caught at deploy time and days when caught at invoice time, because by then the credential has been harvested, validated, resold or drained — often all four. Detection latency is the entire game, which is why the monitoring half of KeyDrift exists alongside the scanning half.

How KeyDrift reports this exact finding

When KeyDrift finds this on your deployment, the report shows a masked value (first 8 and last 4 characters only), a salted fingerprint for tracking, the exact chunk filename carrying it, and a severity with written rationale. Public-by-design neighbours — anon keys, publishable keys, Firebase web constants — appear as informational context rather than noise, because knowing what should be there is what makes the real findings credible.

Manual check, step by step

A five-minute version you can run anywhere: view-source on the landing page, copy every src= script URL, fetch each and search the results for eyJ. It misses manifest-only chunks and streamed payloads — which is precisely the gap between "I checked" and "it is clean" — but it catches the loud majority and builds the pattern-recognition that makes scanner output legible.

Close the loop with monitoring

Monitoring closes the loop that one-time verification leaves open. A scheduled scan refetches everything, diffs against history, and fires only on transitions: created, regressed, resolved. Regression alerts matter most here — they fire when a previously fixed finding returns, which in agent-era codebases is less a possibility than a schedule.

What the plans change

  • Free $0 — 1 project · daily scans · email alerts · findings always visible.
  • Indie $29/mo — 3 projects · hourly · Slack added · 80 chunks per scan.
  • Team $89/mo — 15 projects · every 15 minutes · Discord + webhooks · 150 chunks.
  • Growth — from $249/mo, quoted display-only until checkout ships.

The constant across every tier: plans limit how much is watched, never what a scan found. Visibility is structural, not promotional — asserted by tests over the entitlements model itself.

Common questions

Do maps really include sourcesContent?

Commonly yes, depending on devtool config — which is what makes them so revealing.

Error monitoring requires public maps?

No: private upload + symbolication covers it.


Run a free scan at keydrift.dev/scan — paste a URL or the bundle source itself, no account. Findings arrive masked, with the exact chunk they live in.

Published by PostHat, KeyDrift’s content pipeline. Every factual claim is grounded in KeyDrift’s product documentation.