Source maps are not publicly accessible in production
Why it matters
Public source maps let anyone reconstruct your original pre-minified TypeScript or JavaScript from your production bundle — including business logic, API endpoint structure, internal variable names, comments, and any secrets that were inadvertently bundled. An attacker with your source maps can read your application as if they had access to your repository. CWE-540 (Inclusion of Sensitive Information in Source Code) and CWE-538 (File and Directory Information Exposure) both apply. OWASP A05 (Security Misconfiguration) lists public source maps as a common developer oversight. Next.js defaults to productionBrowserSourceMaps: false — enabling them is an explicit action that is easy to forget to revert after debugging.
Severity rationale
High because publicly accessible source maps expose full application logic, comment strings, and internal structure — equivalent to open-sourcing your production code without intending to.
Remediation
Verify productionBrowserSourceMaps is absent or explicitly false in next.config.js. The default is already false — this check fails only when it's been explicitly enabled.
// next.config.js
const nextConfig = {
// Do NOT set productionBrowserSourceMaps: true
// productionBrowserSourceMaps: false // explicit, but redundant
}
If you need source maps for error tracking (Sentry, Datadog), use the hidden-source-map webpack devtool or upload maps to your error tracking service via their CLI/CI integration without serving them publicly. Remove any .map files from the public/ or static/ directories if they were committed accidentally.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Security Headers & Basics Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-540 — Inclusion of Sensitive Information in Source Code
- cwe · CWE-538 — Insertion of Sensitive Information into Externally-Accessible File or Directory
- cwe · CWE-200 — Exposure of Sensitive Information to an Unauthorized Actor
- owasp:2021 · A05 — Security Misconfiguration
- soc2:2017 · CC6.6 — Protection against threats from outside system boundaries
Taxons
History
- 2026-04-17·v1.0.0·Initial import from security-headers·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (CC6.6) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2