Read the docs

Terser leaks input source code through source map sourcesContent

Priority LOW 39CWE-540Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Impact type
—
Confidentiality · integrity · availability
Low · None · None
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA.

Summary

Terser, a JavaScript parser, mangler, and compressor toolkit, copies the sourcesContent of an input source map into the generated source map even when includeSources is false, in versions before 4.8.2 and from 5.0.0 before 5.51.3. This exposes sensitive information in source code (CWE-540) such as comments, constants, or embedded secret tokens. Anyone who receives the generated source map can read the original source code.

Written with Claude Haiku 5.5 from the sources below · 2026-11-30

Description from the CNA

Terser is a JavaScript parser, mangler, and compressor toolkit for ES6+. Prior to 4.8.2, and from 5.0.0 to before 5.51.3, when minify() is given an input source map through the sourceMap.content option, Terser copies that map's sourcesContent into the generated source map even when includeSources is false. Anyone who receives the generated source map can read the original source code, which may include comments, constants, or embedded secret tokens. This issue is fixed in versions 4.8.2 and 5.51.3.

Why it matters now

Fix Fixed terser (terser): 5.51.3, 4.8.2

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
terserterser5.0.0 to before 5.51.3; before 4.8.25.51.3, 4.8.2Patch availableCNA
  • terser Vendorterser Affected 5.0.0 to before 5.51.3; before 4.8.2 Fixed in 5.51.3, 4.8.2 Patch available CNA

Remediation

Upgrade terser to version 4.8.2 for the 4.x branch or to version 5.51.3 for the 5.x branch.

Written with Claude Haiku 5.5 from the sources below · 2026-11-30

  • Fix · CNA terser (terser) Fixed in 5.51.3, 4.8.2

Timeline

  1. 2026-11-30 Threatist record created from CVE-2026-140012

References

  • TI-2022-17523 A Regular Expression Denial of Service (ReDoS) flaw was found in kangax html-minifier… CVSS 3.1HIGH 7.5
  • TI-2022-09424 Regular expression denial of service (ReDoS) in terser CVSS 3.1HIGH 7.5

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences