Terser: Input sourcemap sourcesContent leaks, revealing input source code
- CVE-2026-140012
- GHSA-6jpm-p5cq-9q44
- EUVD-2026-139738
Description
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.
Text from the CVE.org record.
Recommendation
terser
- If you run a version from 5.0.0 to before 5.51.3update to 5.51.3 or laterMinor version change: check the release notesterser 5.51.3 on its registry (opens in a new tab)
- If you run a version before 4.8.2update to 4.8.2 or laterterser 4.8.2 on its registry (opens in a new tab)
Taken from the version ranges the sources state. Check the vendor advisory: nothing is said about versions the ranges do not list. Breaking-change risk is read from the version numbers only.
Affected
terser
Affected versions Fixed in >= 5.0.0, < 5.51.3 none stated < 4.8.2 none stated tersernpm
Affected versions Fixed in from 5.0.0 to before 5.51.3 5.51.3 before 4.8.2 4.8.2
Product versions from the CVE.org record.
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.