NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
MEDIUM severity

Terser: Input sourcemap sourcesContent leaks, revealing input source codeGHSA-6jpm-p5cq-9q44

MEDIUMFix: terser/terser@a63e814

GHSA-6jpm-p5cq-9q44 is a medium-severity (CVSS 5.3) CWE-540 vulnerability in terser. A fix is available for terser — see the affected versions and patch details below.

Also known asCVE-2026-140012
Published
Updated
Affected
2 pkgs
Patched
2 / 2
Exploits
None indexed
Exploitation data as of Dec 1, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
0.4%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs41th percentile — riskier than 41% of all scored CVEsHighest risk

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

2 pkgs affected
📦terser📦terser

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm packages — download data is not available via public APIs for these ecosystems.

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.

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:

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).

Affected Packages

2 total 2 fixed
EcosystemPackageVulnerable rangeFix
📦npmterserall versions4.8.2npm install terser@4.8.2
📦npmterser≥ 5.0.0&&< 5.51.35.51.3npm install terser@5.51.3

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for terser, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update terser to 4.8.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-6jpm-p5cq-9q44 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

Frequently Asked Questions

### 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 ma
O3 Security · Impact-Aware SCA

Is GHSA-6jpm-p5cq-9q44 in your dependencies?

Find it across npm, including transitive dependencies.

Terser: Input sourcemap sourcesContent leaks, revealing…