CVE-2026-140012 — Terser — CWE-540
### 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).
### 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).
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CVE-2026-140012
CVSS 5.3/10 · MEDIUM · 30.11.2026
CWE: CWE-540
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT IS THIS VULNERABILITY?
Summary: ### 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 debu…
Affected: terser terser
⚡ ATTACK VECTOR
Network / Remote (AV:N) · no authentication required (PR:N) · no user interaction (UI:N) · low attack complexity (AC:L).
🌍 REAL WORLD IMPACT
Partial confidentiality disclosure (C:L).
🛡️ REMEDIATION
→ Apply vendor security update for terser terser.
→ Pre-patch: put service behind VPN or apply IP allowlist.
→ Add WAF rule, create IDS alert for anomalous traffic.
⚠️ URGENCY
📋 Routine update cycle (30 days)
────────────────────────────────────────
[Automated Technical Vulnerability & CVSS Vector Analysis]
FOFA Query