Skip to main content
VulnerabilityPublished

CVE-2026-140012: Terser · Input sourcemap sourcesContent leaks, revealing input source code

Affects terserSource GCVE Database

0
Compare
Authoritative record:CVE-2026-140012· Medium 5.3

Not known to be exploited · CVSS 5.3 Medium : upgrade to 4.8.2 when convenient.

Data as of 1 Dec 2026, 19:00 UTC

CVSS 3.1 base score
5.3Medium
How severe the flaw is on the 0–10 CVSS scale.

Thin evidence

One scorer or none
CVSS scores by source
CNA (GitHub_M)CVSS 3.15.3
Patch
Available – fixed in 4.8.2, 5.51.3
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 30 Nov 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 1 Dec 2026.

What to do

Upgrade terser to 4.8.2; terser to 5.51.3.

Affected software

ProductAffectedFixed in
npmterserAffected
  • <4.8.2
Fixed in
  • 4.8.2
npmterserAffected
  • >=5.0.0 <5.51.3
Fixed in
  • 5.51.3

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

Description

### Impact Leakage of user source code, which may include comments, constants with secret tokens, etc. When using Terser with an input sourcemap (sourceMap.content), and this input sourcemap has original source information (`sourcesContent`), Terser leaks this `sourcesContent` into the output, even when the user specified `includeSources: false` to opt-out. ### Details To help developers debug their JS applications, Terser's minify function reads and produces [source maps](https://developer.mozilla.org/en-US/docs/Glossary/Source_map). To minify a JS file that has a corresponding source map, and generate a source map in turn, we call Terser's minify function like so: ```js const out = await minify(INPUTFILE, { sourceMap: { content: INPUTMAP, }, }); out.map // output source map ``` Source maps may contain the content of files, in their `sourcesContent` property. Files which may include secrets. Terser shouldn't include `sourcesContent` by default, unless we pass `includeSources: true` under `sourceMap` options. But it does include the `sourcesContent` of the INPUTMAP even if `includeSources: false`, which is the leak we're discussing. ### Patches The problem will be patched in version `5.51.3`, and `4.8.2`. ### Workarounds Do not use an input sourcemap (`sourceMap.content` option).

References

Community reviews

Loading reviews…