Plan this weekVulnerabilities

cross-spawn, an npm package inside countless Node.js projects: command injection on Windows when running .bat or .cmd files; update again, to 7.1.2 or 6.0.10

Between 1 and 4 December 2026 the cross-spawn maintainers published three advisories about running batch files on Windows, one critical (CVE-2026-137199) and two high. Versions 7.1.0 and 6.0.7 are no longer enough: the latest one is fixed in 7.1.1 and 6.0.8, and 7.1.2 and 6.0.10 also repair a bug those releases brought. How to check your projects.

Updated 5 Dec 2026: see what changed

How urgent

Plan this week

Who is affected

Node.js programs running on Windows that use cross-spawn before 7.1.1 (or before 6.0.8 on the 6.x line), directly or through another package, to launch .bat or .cmd files with arguments that can come from outside (user input, file names, web requests). Versions before 6.0.0 are not maintained. Linux and macOS are not affected

What to do

Run npm ls cross-spawn in each project and update so every copy is 7.1.2 or later (or 6.0.10 on 6.x), refreshing the lockfile; update global tools on Windows build machines too. Pass the program as the command and its arguments in args, and do not pass untrusted text as arguments to batch files

Published 1 Dec 2026 · Sources last checked 5 Dec 2026No. 150 / 168

Updates, follow-ups and corrections

  1. Update · 5 Dec 2026. Third advisory (CVE-2026-137197, high, 4 Dec): versions 7.1.0 and 6.0.7 are NOT enough. Commands written with quotes or spaces could still reach cmd.exe wrongly escaped. Fixed in 7.1.1 and 6.0.8; we recommend 7.1.2 or 6.0.10
  2. Update · 4 Dec 2026. A second cross-spawn advisory (CVE-2026-137198, high) covers argument injection on Windows through backslashes before a double quote, in 7.0.4 up to before 7.1.0 and in 6.0.6. Same fixed versions: 7.1.0 or 6.0.7

We keep the original text. When something changes, when we follow a story, or when we get something wrong, we add a dated note here instead of editing silently.

Watch the short video

The video loads from YouTube (privacy-enhanced mode) only when you press play.

Update, 5 December: 7.1.0 is not enough

On 4 December a third advisory appeared, CVE-2026-137197, rated high. The fix in 7.1.0 and 6.0.7 only applied when cross-spawn recognised that the command was a batch file. It could miss it, and escape the arguments the wrong way, when the command contained double quotes, a space, a tab, ,, ; or =, ended in whitespace, or was found through a custom PATHEXT passed in options.env. With untrusted arguments, that allowed running arbitrary commands.

Fixed in: 7.1.1 and 6.0.8. The maintainers then released 7.1.2 and 6.0.10 to repair a problem the earlier fixes caused: batch files found in PATH, such as Gradle's, could no longer find their own folder. Those two are the ones we suggest.

One change to check: since 7.1.1, on Windows the command must be the name or path of a single program. spawn('npm install') now fails; write spawn('npm', ['install']).

There is also a cross-spawn 8.0.0, which needs Node.js 22.13 or later and changes how it is imported, so treat it as a migration rather than a quick patchPatch (security update) A fix released by the maker of a piece of software to close a flaw or a bug. Tap again to open the glossary.

What happened

cross-spawn is a small npm package that lets Node.js programs launch other programs the same way on Windows, macOS and Linux. Few people install it on purpose, but it sits inside a huge number of projects as a dependency of build tools, test runners and command-line utilities.

On 1 December 2026 its maintainers published CVE-2026-137199, rated critical.

The flaw

According to the advisory, on Windows cross-spawn runs anything that is not an .exe or .com, such as a .bat or .cmd batch file, through cmd.exe, and escapes the command and its arguments for it. A batch file that passes its arguments on (for example with %*) makes cmd.exe read them a second time. cross-spawn only handled that second reading for the small helper files npm puts in node_modules/.bin.

For any other batch file, such as npm.cmd, global tool shims or your own scripts, an argument crafted by someone else could break out of its quotes and run another command, with the permissions of your program. The advisory shows it opening the Windows calculator.

Affected by this first flaw: cross-spawn 7.0.0 up to 7.0.x, and anything before 6.0.7. It was fixed in 7.1.0 and 6.0.7, but see the update above for the versions to install today. Linux and macOS are not affected. The advisory does not report exploitation.

Does it affect you?

Only if all three are true: the program runs on Windows, it uses an old cross-spawn (yours or a dependency's), and it launches a batch file passing an argument that someone outside can influence: a form field, a file or branch name, a web request. A developer tool that only runs your own fixed commands is much less exposed. Build servers that process other people's pull requests are a typical risky case.

What to do

  1. In each Node.js project, run npm ls cross-spawn (or pnpm why cross-spawn, yarn why cross-spawn) to see every copy and its version.
  2. Update so every copy is 7.1.2 or later (6.0.10 if a package pins 6.x). Often npm update and a fresh lockfile are enough; if an old package pins it, use overrides in package.json (our advice).
  3. On Windows build machines, update globally installed Node.js tools too.
  4. Until you can update, do not pass untrusted text as arguments to .bat or .cmd files.

What we could not confirm

We read the advisories directly. They do not say how the flaws were found or whether they have been used. We do not know which popular tools pass outside input to batch files through cross-spawn; that depends on each tool.

Glossary: vulnerabilityVulnerability A weakness in software, a setting or a process that an attacker could use to get in or do harm. Tap again to open the glossary, patch, dependency. See also our free tool trust check before you install a package.

Keep reading

More stories on the same topic or from the same area.

Comments

No account needed. Add a nickname if you like, or leave it empty to comment anonymously. Comments are reviewed before they appear. Links are not allowed.

    We store your comment, your nickname and a scrambled form of your connection that we use only to limit spam. We do not store your IP address or set cookies. Cloudflare Turnstile checks that you are not a bot.

    Sources and verification

    We use primary sources first and say when we rely on a news report. Dates are the day we last checked each source.

    Spotted a mistake? Email [email protected] and we will correct it and note the change.

    Newsletter · every Friday · free

    Get the weekly security briefing

    One email every Friday: what to act on now and what to plan this week, in plain words. The free one-page runbooks come in your welcome email. You confirm your address first.

    Subscribe for free

    Press / to search from any page