{"id":"CVE-2026-140012","aliases":["GHSA-6jpm-p5cq-9q44"],"url":"https://o3.security/vulnerability/CVE-2026-140012","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).","published":"2026-11-30T21:56:49.877Z","modified":"2026-12-01T21:02:40.412006757Z","cvss":{"score":5.3,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"},"epss":{"score":0.00449,"percentile":0.40752,"asOf":"2026-12-01"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"terser","fixedVersion":"4.8.2"},{"ecosystem":"npm","name":"terser","fixedVersion":"5.51.3"}],"fix":{"url":"https://github.com/terser/terser/commit/a63e814e816405e1d9cad106b1aeaa29c5c12bdc","label":"terser/terser@a63e814"},"references":[{"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"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/140xxx/CVE-2026-140012.json"},{"type":"ADVISORY","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":"FIX","url":"https://github.com/terser/terser/commit/a63e814e816405e1d9cad106b1aeaa29c5c12bdc"},{"type":"FIX","url":"https://github.com/terser/terser/commit/bab93bde6e2156cdd2fdd27eadc4dffd7362dee3"},{"type":"PACKAGE","url":"https://github.com/terser/terser"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-12-01T21:02:40.412006757Z"}}