{"schema_version":"1.9.2","id":"GHSA-m6qr-m48x-3xhh","published":"2026-12-04T00:14:09Z","modified":"2026-12-04T00:30:03.094090936Z","aliases":["CVE-2026-137198"],"summary":"cross-spawn: Argument injection on Windows via backslashes before a double quote","details":"### Impact\n\nOn Windows, when `cross-spawn` runs a command through `cmd.exe`, it quotes each argument and doubles the backslashes that precede a double quote or the end of the argument, so that they aren't taken as escaping the quote.\n\nSince `7.0.4`, `7.0.5` and `6.0.6`, which changed the regular expressions to fix a ReDoS vulnerability (GHSA-3xgq-45jj-v275), backslash runs weren't doubled correctly: `7.0.4` didn't double them at all, and `7.0.5`, `7.0.6` and `6.0.6` added only one backslash to each run. An argument with two or more backslashes before a double quote, or at its end, had its closing quote escaped, which let it split into extra arguments or swallow the next ones:\n\n```js\nconst spawn = require('cross-spawn');\n\n// On Windows, the program received two arguments: `x\\\\` and `--evil`\nspawn.sync('foo.cmd', ['x\\\\\\\\\" --evil']);\n```\n\nThe caller can't tell: the command still exits successfully and nothing is written to stderr. Even an ordinary directory path such as `C:\\some\\dir\\\\` makes the caller's following arguments disappear.\n\nApplications are affected if they pass untrusted input as arguments to a command that runs through `cmd.exe` on Windows, which includes every npm cmd-shim in `node_modules/.bin`. The impact depends on the program: one that accepts extra arguments may act on the injected ones, e.g. a tool called with `--check` receiving an injected `--write`, while one that rejects an unexpected argument fails instead. This doesn't allow running other commands. Other platforms aren't affected.\n\n### Patches\n\nThis is fixed in `7.1.0` and `6.0.7`, which escape backslashes with a loop that handles any number of them in linear time.\n\n### Workarounds\n\nValidate untrusted input so that only a safe subset is allowed.\n\n### Credits\n\nMOXY Studio thanks Duong Bui Thai ([LinkedIn](https://www.linkedin.com/in/thaiducng/)) for privately reporting this vulnerability, and both @trackoor and @ogffx for independently reporting and fixing it in #188 and #190.","affected":[{"package":{"name":"cross-spawn","ecosystem":"npm","purl":"pkg:npm/cross-spawn"},"ranges":[{"type":"SEMVER","events":[{"introduced":"7.0.4"},{"fixed":"7.1.0"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-m6qr-m48x-3xhh/GHSA-m6qr-m48x-3xhh.json"}},{"package":{"name":"cross-spawn","ecosystem":"npm","purl":"pkg:npm/cross-spawn"},"ranges":[{"type":"SEMVER","events":[{"introduced":"6.0.6"},{"fixed":"6.0.7"}]}],"versions":["6.0.6"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-m6qr-m48x-3xhh/GHSA-m6qr-m48x-3xhh.json"}}],"references":[{"type":"WEB","url":"https://github.com/moxystudio/node-cross-spawn/security/advisories/GHSA-m6qr-m48x-3xhh"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-137198"},{"type":"WEB","url":"https://github.com/moxystudio/node-cross-spawn/issues/188"},{"type":"WEB","url":"https://github.com/moxystudio/node-cross-spawn/pull/160"},{"type":"WEB","url":"https://github.com/moxystudio/node-cross-spawn/pull/162"},{"type":"WEB","url":"https://github.com/moxystudio/node-cross-spawn/pull/191"},{"type":"WEB","url":"https://github.com/moxystudio/node-cross-spawn/pull/192"},{"type":"WEB","url":"https://github.com/moxystudio/node-cross-spawn/commit/1b71aa519a2e4f97d1f3ee27f0e2fc24ba17cf1a"},{"type":"WEB","url":"https://github.com/moxystudio/node-cross-spawn/commit/244ffeaa8473de0080c93ebbf779bb953b94114b"},{"type":"PACKAGE","url":"https://github.com/moxystudio/node-cross-spawn"},{"type":"WEB","url":"https://github.com/moxystudio/node-cross-spawn/releases/tag/v6.0.7"},{"type":"WEB","url":"https://github.com/moxystudio/node-cross-spawn/releases/tag/v7.1.0"}],"database_specific":{"cwe_ids":["CWE-88"],"github_reviewed":true,"github_reviewed_at":"2026-12-04T00:14:09Z","nvd_published_at":"2026-11-30T21:17:25Z","severity":"HIGH"},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N"}]}