cross-spawn before 7.1.0 and 6.0.7: command injection on Windows through batch files, update now
Node.js developers on Windows whose code, or whose dependencies, pass untrusted input as arguments to a command that runs through a batch file.
How to fix it
You haveUpdate to
>= 7.0.0, < 7.1.0→7.1.0< 6.0.7→6.0.7
Check your version
Which version your project hasnpm ls cross-spawn
Update
In your projectnpm update cross-spawn npm ls cross-spawn
npm explain cross-spawn
npm audit
If you can't update yet
Validate untrusted input so only a safe subset is allowed, and call executables directly rather than through batch files.
Only Windows is affected. A crafted argument to a batch file such as npm.cmd could break out of its quotes and run any command. Lots of tools depend on cross-spawn, so check your lockfile too. Code that sets options.shell was never escaped and still isn't, and the maintainers say some batch files can't be made safe by any escaping.
If npm ls still shows an old version under another package, update that package, or add an "overrides" entry for this one in package.json.