Node.js Version
v24.0.1
NPM Version
11.3.0
Operating System
macOS Sequoia 15.3.2
Subsystem
child_process
Description
When using child_process.spawnSync() with an Array of arguments, I’m getting this warning:
DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
I don’t see a simple way around that:
- Command and arguments are passed to my function as an Array.
- I can do my own concatenation but how is that any better than what Node.js is doing?
- If I set
shell:false then, e.g., I can’t invoke npx <some-package>.
Minimal Reproduction
No response
Output
No response
Before You Submit