At a glance
- Controls
- CWE-540 · A01:2021 Broken Access Control
What it is
Build tools create source maps so developers can debug compressed JavaScript. When these files ship to production, anyone can download them and rebuild the original source. That includes comments, hidden routes, feature flags and sometimes keys left in the code.
Attackers use the rebuilt source to find admin pages, unused API endpoints and checks that only run in the browser. This shortens their search for weaker targets. AI-assisted attackers can read a whole rebuilt code base quickly and list every endpoint and interesting comment.
Where it hides
What a reviewer can look for in the code and in the behaviour, before anyone proves it.
- JavaScript bundles with a sourceMappingURL comment at the end
- .map files sitting next to bundles on the CDN
- Build settings that differ between staging and production
- Admin and internal tools built with the same pipeline
How MATT tests it
The proof runs against the deployed product, on every release, whoever wrote the code.
- 01Load the production site and list every JavaScript file it requests.
- 02Request the matching .map file for each bundle and note which ones return content.
- 03Rebuild the source from any returned map and list the internal routes and comments it reveals.
Production must not publish source maps or internal code.
Executable checkas anonymous: GET /assets/{bundle}.js expect: no sourceMappingURL comment in the body as anonymous: GET /assets/{bundle}.js.map expect: 403 or 404
Every rule MATT holds →What the fix looks like
- 01
Turn off public source map output in the production build.
- 02
If maps are needed for error tracking, upload them privately to that tool.
- 03
Strip comments and dead code from production bundles.
- 04
Keep secrets out of front‑end code entirely, since everything shipped to the browser is readable.
A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →