Skip to content
VITI Security

Why an Exposed JavaScript Source Map Is a Bug Hunter's Shortcut

by VITI Security TeamSep 26, 2026

A public source map can hand over a site's original, unminified code, and whatever secrets got baked into it. Vexta reconstructs that source automatically and scans it for hardcoded keys and hidden endpoints.

Why an Exposed JavaScript Source Map Is a Bug Hunter's Shortcut - VITI Security

JavaScript source map security is about whether a site's public source maps let anyone rebuild the original, pre-minification code a team meant to keep off the public internet. Vexta is VITI Security's agentless, AI-augmented vulnerability scanner and pentest platform, and it treats every exposed source map as a lead worth following: it reconstructs the real source behind a minified bundle, then checks that recovered code for hardcoded secrets and hidden endpoints most manual reviews never get around to. A source map is a debugging file that maps minified, one-line JavaScript back to its original file names, function names and line numbers, and it is meant to sit on a developer's machine or a private build server, not ship to production.

How does Vexta find an exposed source map?

Vexta checks every JS asset its crawler discovers for a //# sourceMappingURL= comment, the line a build tool leaves behind to point a browser's dev tools at the matching map file. Where a lot of manual review stops at noticing the comment exists, Vexta goes a step further and pulls the map itself.

From there it reconstructs the original, pre-minification source using the map's sourcesContent array, which many build configurations embed by default so the map is self-contained. The result is not a guess at what the minified code might mean; it is the actual source file, comments, real variable names and all, exactly as a developer wrote it before a bundler compressed it down.

That distinction is what makes this worth automating. Reading minified JavaScript by eye to spot a hardcoded key or a stray API call is slow and error-prone even for an experienced reviewer, because a single line can hold thousands of characters with no meaningful names left in it. A reconstructed file reads like normal source code, which is what lets a static pattern check run against it with any accuracy.

What secrets does Vexta look for in the recovered source?

Once source is reconstructed, Vexta runs it through static analysis for 18 distinct secret-pattern matches, the kind of hardcoded credential that ends up in a front-end bundle by accident during a rushed deploy or a copy-pasted config:

  • AWS access and secret keys
  • GitHub personal access tokens, both classic and fine-grained
  • GitLab personal access tokens
  • Slack bot tokens and incoming webhooks
  • Stripe live keys
  • OpenAI and Google API keys, plus Mapbox tokens
  • JWTs and private-key blocks
  • Twilio, SendGrid and Square credentials

What else turns up besides secrets?

Recovered source is also a map of the application the public site map does not show. Vexta surfaces hidden endpoints referenced from JavaScript, things like /admin, /internal, /debug, underscore-prefixed routes, and staging or dev paths that a front-end call still points at even though nobody linked to them from the visible site.

These routes are common because front-end code tends to outlive the environment it was written for. A developer wires up a call to a staging admin panel during testing, ships the bundle, and forgets the reference is still sitting in the JavaScript everyone's browser downloads. Nothing about the public pages hints it exists, but the source map does.

A hunter working from the crawled site map alone would never see these routes at all, because nothing links to them. Reading the reconstructed source is the only way to know they are there, which is exactly why this kind of recovery earns a place in a scan even when the target's public pages look thoroughly mapped already.

Why this matters for a bug hunter

For the effort involved, source map recovery is disproportionately productive. Reading through pretty-printed original source instead of a minified one-liner is faster, and a single reconstructed file can hand a hunter both a working credential and a route the application's owners did not know was reachable, in the time it would otherwise take to fuzz for either one separately.

The finding itself is still subject to the same rules as everything else in scope. A live key found this way should be reported for rotation, not used to poke around further, and a hidden endpoint should be tested the way any in-scope endpoint would be, inside the program's rules or a signed engagement. Point a free scan at your own front end if you want to see whether your build pipeline is shipping source maps it shouldn't.

It is also worth checking this on a recurring basis rather than once. Build pipelines change, new dependencies get added, and a source map that was stripped from a production build six months ago can quietly reappear after a deployment tooling change nobody flagged as security-relevant. A scan that checks for this automatically on every run catches that kind of regression before it sits exposed for months.

Key takeaways

The essentials on how Vexta handles exposed source maps:

  • Vexta checks every discovered JS asset for a sourceMappingURL comment and pulls the matching map
  • It reconstructs the original, pre-minification source from the map's sourcesContent array
  • Recovered source is scanned for 18 secret patterns, including AWS keys, GitHub and GitLab PATs, Slack tokens, Stripe live keys, JWTs and private-key blocks
  • It also surfaces hidden endpoints like /admin, /internal, /debug and staging or dev routes referenced in JS but absent from the public site map
  • Findings from recovered source still go through the same in-scope, responsible-disclosure rules as any other finding

Frequently asked questions

What is a JavaScript source map?
A source map is a file a build tool generates that maps minified, compressed JavaScript back to its original file names, variable names and line numbers, meant for debugging rather than public distribution.
How does Vexta detect an exposed source map?
Vexta checks every JS asset its crawler discovers for a sourceMappingURL comment, then pulls the map and reconstructs the original source from its sourcesContent data.
What kinds of secrets can source map recovery catch?
Vexta's static analysis checks recovered source for 18 secret patterns, including AWS keys, GitHub and GitLab personal access tokens, Slack tokens and webhooks, Stripe live keys, OpenAI and Google API keys, Mapbox tokens, JWTs, private-key blocks, and Twilio, SendGrid and Square credentials.
Can this feature find hidden pages, not just secrets?
Yes. Vexta surfaces hidden endpoints such as /admin, /internal, /debug, underscore-prefixed routes, and staging or dev paths that are referenced in the recovered JavaScript but do not appear in the public site map.
What should I do if I find a live secret in a source map?
Report it for rotation through the program's or client's disclosure process rather than using it further, and only test any endpoint it reveals if that endpoint is inside the authorized scope.

Find out if your build is shipping source maps it shouldn't

Run a free Vexta scan against your own site, or check the pricing page to see which plan covers ongoing scans.