Exposed source maps

Why a public source map can hand over your original, unminified code, how the scan finds one, and how to stop publishing it.

What AuditX checks

The scan takes the scripts your page loads from your own domain, in page order, up to 20 of them. Scripts hosted on other domains are skipped. For each script it reads the end of the file for a sourceMappingURL comment. It then fetches the map that comment points to, or decodes the map if it is embedded in the comment. With no comment it tries the script address plus .map. A file counts as a source map when it is JSON with a version, a list of sources and a mappings string. It fails when at least one script has a map that includes the original source code, and it names up to three of them. A map without the source code, as many sites ship for error reports, passes. Maps that come with a Shopify theme, a WordPress plugin or a well-known open-source library give an info note instead, because that code is already public. It gives an info note too when the page has no scripts on your own domain. It passes when no checked script exposes source. Maps larger than 15 MB and failed requests count as no map found. If no script request completes, the check is shown as not measured and is left out of the score. If the scanner has its security probes switched off, the check is not run at all. The scan does not search the recovered code for passwords or keys.

Why it matters

A source map links the compressed script your visitors download back to the code your developer wrote. When the map includes the original code, anyone can read it with comments, file names and internal structure.

That makes it easier to find weak spots and to copy your work. It does not by itself give anyone access to your site, but code sometimes holds notes, test addresses or keys that were never meant to be public.

How to fix it

  1. Ask your developer to stop uploading .map files to the live site, or to build without source maps for production.
  2. If you need maps to read error reports, keep them private or upload them only to your error-tracking service. If a map must stay public, build it without the original source included (without sourcesContent).
  3. Add a server rule that blocks requests for *.map files. Then open one of your script addresses with .map added and check that you get an error.
  4. Look through the code that was exposed for keys, passwords and private addresses. Change any you find.
# nginx
location ~* \.map$ {
    deny all;
}

Does your site pass this check? A free scan runs it with every other check and shows the result in about a minute.

Scan my site

Sources

Related checks

Last reviewed 2026-11-13.