Skip to main content
LowContentOWASP A05:2021CWE-540

How to fix: JavaScript Source Map Reference Found

A //# sourceMappingURL comment pointing to a .map file was found in the page's JavaScript, indicating a source map may be deployed alongside the production bundle.

Why it matters

If the referenced .map file is publicly fetchable, anyone can reconstruct the original, un-minified source: business logic, internal endpoint names, and code comments.

Bundlers emit a sourceMappingURL comment by default. The comment alone isn't a vulnerability -- the risk depends on whether the referenced .map file is actually served publicly.

How to fix it

  1. 1Verify whether the referenced .map file is publicly fetchable; if not, this is informational only.
  2. 2Disable source map generation for production builds, or use a 'hidden' mode that omits the reference comment.
  3. 3If source maps are needed for error tracking, upload them to your error-tracking service and keep them off the public web server.

Code examples

Disable source maps in production

TypeScript
// next.config.mjs: disable source maps in production builds
export default {
  productionBrowserSourceMaps: false,
};

// Vite:
// build: { sourcemap: false }

// If source maps are needed for error tracking, upload to Sentry
// and exclude them from the public web server

References

Detected automatically by VulnRadar. The check id is sourcemap-reference, stable across every scan so you can filter or diff on it.

See every content check

Questions

How severe is JavaScript Source Map Reference Found?
VulnRadar rates this low severity in the content category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id sourcemap-reference, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does JavaScript Source Map Reference Found map to?
It maps to CWE-540. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for javascript source map reference found

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

JavaScript Source Map Reference Found fix | VulnRadar