Vulnerability GHSA-6jpm-p5cq-9q44

Medium Risk
MEDIUM RISK
CVSS Score: 5.3
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
16 hours ago
December 01, 2026 at 06:35 PM UTC
Terser: Input sourcemap sourcesContent leaks, revealing input source code
0.0.1 - 4.8.1 and 5.0.0 - 5.51.2
0.0.1 - 4.8.1 and 5.0.0 - 5.51.2

Summary

Terser: Input sourcemap sourcesContent leaks, revealing input source code

Details

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

Impacted packages

Timeline

Published
16 hours ago
December 01, 2026 at 06:35 PM UTC
Fixed (5.51.3)
12 days ago
November 20, 2026 at 08:40 AM UTC
Fixed (4.8.2)
12 days ago
November 20, 2026 at 08:46 AM UTC
Last Modified
16 hours ago
December 01, 2026 at 06:45 PM UTC