{"id":"GHSA-6jpm-p5cq-9q44","summary":"Terser: Input sourcemap sourcesContent leaks, revealing input source code","details":"### Impact\n\nLeakage of user source code, which may include comments, constants with secret tokens, etc.\n\nWhen 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.\n\n### Details\n\nTo 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).\n\nTo 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:\n\n```js\nconst out = await minify(INPUTFILE, {\n    sourceMap: {\n        content: INPUTMAP,\n    },\n});\nout.map // output source map\n```\n\nSource maps may contain the content of files, in their `sourcesContent` property. Files which may include secrets.\n \nTerser shouldn't include `sourcesContent` by default, unless we pass `includeSources: true` under `sourceMap` options.\n\nBut it does include the `sourcesContent` of  the INPUTMAP even if `includeSources: false`, which is the leak we're discussing.\n\n### Patches\n\nThe problem will be patched in version `5.51.3`, and `4.8.2`.\n\n### Workarounds\n\nDo not use an input sourcemap (`sourceMap.content` option).","aliases":["CVE-2026-140012"],"modified":"2026-12-01T18:45:08.402573855Z","published":"2026-12-01T18:35:11Z","database_specific":{"cwe_ids":["CWE-540"],"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2026-12-01T18:35:11Z","nvd_published_at":"2026-11-30T22:17:31Z"},"references":[{"type":"WEB","url":"https://github.com/terser/terser/security/advisories/GHSA-6jpm-p5cq-9q44"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-140012"},{"type":"WEB","url":"https://github.com/terser/terser/commit/a63e814e816405e1d9cad106b1aeaa29c5c12bdc"},{"type":"WEB","url":"https://github.com/terser/terser/commit/bab93bde6e2156cdd2fdd27eadc4dffd7362dee3"},{"type":"PACKAGE","url":"https://github.com/terser/terser"},{"type":"WEB","url":"https://github.com/terser/terser/releases/tag/v4.8.2"},{"type":"WEB","url":"https://github.com/terser/terser/releases/tag/v5.51.3"}],"affected":[{"package":{"name":"terser","ecosystem":"npm","purl":"pkg:npm/terser"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"4.8.2"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-6jpm-p5cq-9q44/GHSA-6jpm-p5cq-9q44.json"}},{"package":{"name":"terser","ecosystem":"npm","purl":"pkg:npm/terser"},"ranges":[{"type":"SEMVER","events":[{"introduced":"5.0.0"},{"fixed":"5.51.3"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-6jpm-p5cq-9q44/GHSA-6jpm-p5cq-9q44.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"}]}