Explainer · Client-side exposure
What is source map exposure?
Source map exposure is when the source map files that build tools create for debugging are published on a production website. Anyone can use them to rebuild your original front-end code, with its comments, file paths and internal routes. It is easy to check for and usually quick to fix.
What an exposed source map gives away
Minified JavaScript is public, but slow to read. A source map undoes the minification and turns reverse engineering into ordinary reading.
-
Readable source code
Original files, folder structure, variable names and developer comments, often including parts of files that the bundle itself left out.
-
A map of your back end
API routes, internal hostnames, admin paths and feature flags the front end refers to, sometimes including features you have not released yet.
-
Secrets that should not be there
Keys and tokens hard-coded in front-end code are public either way. A source map makes them far easier to find.
-
Your dependencies
Bundled file paths show which open-source packages you ship, and sometimes their versions, which an attacker can compare with published CVEs.
How source maps end up in production
Build tools bundle and minify JavaScript and CSS before release. To keep that code
debuggable, they can also write a .map file for each bundle: a JSON document, in a format
standardized as ECMA-426, that links each part of the minified output to the original file
and line. When its sourcesContent field is filled in, the map carries the full original
source, not just file names.
Browsers find a map through a comment on the last line of the bundle, such as
//# sourceMappingURL=app.4f9c2.js.map, or through a SourceMap response header. Developer
tools then load it for anyone who opens them.
Exposure usually comes from ordinary build and deploy habits:
- the production build emits maps, and some setups do so by default;
- the deploy step copies the whole build folder, maps included, to the web server, CDN or storage bucket;
- maps meant for an error-monitoring service are uploaded there and also left on the site;
- old bundles and their maps stay reachable after a fix, because hashed files are not always cleaned up.
How to check your own site safely
Run these checks only on sites and applications you own or are authorized to test. Each one uses ordinary requests that a browser would make.
-
Look for the reference
Open a JavaScript file from your production site and read its last line for
sourceMappingURL. Check its response headers forSourceMaporX-SourceMap. -
Request the map
Fetch the referenced URL, or the bundle URL with
.mapadded. A JSON response with asourceslist means the map is public; a filledsourcesContentmeans your source is too. -
Open developer tools
In your browser’s developer tools, open the panel that lists page sources. If you see your original folders and readable files, so can every visitor.
-
Check the pipeline
Confirm whether production builds emit maps, what the deploy step uploads, and whether old builds on your CDN or storage still serve them.
How to fix it and keep it fixed
- Stop publishing maps. Turn them off for production builds, or generate them without
the
sourceMappingURLreference and keep them out of the deploy artifact. - Keep debugging private. If your error-monitoring service needs maps, upload them to it from your build pipeline instead of serving them from your site.
- Remove what is already out. Delete published
.mapfiles from servers, CDN and storage, purge caches and check older builds. - Treat what leaked as public. Review what the maps revealed and rotate any secret that appeared in them. Secrets belong on the server, not in front-end code.
- Add a guardrail. Fail the deploy when a
.mapfile or asourceMappingURLcomment reaches the production artifact.
How NorthBound covers source map exposure
Client-side source exposure is part of our exposure intelligence. On domains you have verified, we look for public source maps and reconstruct the source they expose. The same checks cover public configuration files such as .env and .git/config, which we accept as findings only when the response body matches a real configuration file. Secret values are masked in findings and reports, and full evidence stays in private, access-controlled storage. Our team triages each result and tells your engineers what to fix first.
Questions about source map exposure
Is an exposed source map a vulnerability?
Not by itself. It exposes information that makes real vulnerabilities faster to find. How serious it is depends on what the map reveals: a live API key matters far more than the source of a contact form.
Our front-end code is public anyway. Why does this matter?
Minified code is public but slow to read. A map restores names, comments, structure and file paths, and can include parts of files the bundle never shipped.
Can we keep source maps for error monitoring?
Yes. Upload them privately to your monitoring service from the build pipeline, and do not serve them from your public site.
We deleted the maps. Are we done?
Not yet. Check CDN caches and older builds, and rotate any secret the maps exposed. Assume anything that was public has already been copied.
Find it before an attacker does.
Tell us what you need covered. We will reply from contact@northboundintelligence.com to arrange a scoping call.
Facts on this page verified 11 November 2026.