You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
installPackage in packages/cli/src/lib/wizard/utils/clack/index.ts (around line 512) runs the package manager with spawn(pkgManager.name, installArgs, { shell: true }), and it doesn't quote the arguments. Node concatenates them into one shell command line, so any shell metacharacter in a package spec gets parsed by the shell:
> and < become redirects. A spec of sentry@>=0.52.0 ran as <pm> add sentry@ -D (it installed latest with no version floor) and wrote the command's output to a file named =0.52.0 in the project.
| becomes a pipe.
^ is the escape character in Windows cmd, so caret ranges like pkg@^1.2.3 can be mangled there.
Node also prints DEP0190 for this pattern: passing args with shell: true concatenates them without escaping.
Nothing user-controlled reaches this today, because every package spec the wizard installs is a constant. #2525 works around it by installing sentry@<major>.x, which has no metacharacters. That workaround only holds while every spec stays free of shell syntax.
Proposal
Drop shell: true and pass argv directly. On Windows, resolve <pm>.cmd (npm.cmd, pnpm.cmd, yarn.cmd, and so on) so it still launches without a shell.
Add a test that exercises installPackage's argv handling end to end, with a fake package-manager binary that records its argv instead of a mock of installPackage, including a spec with >, ^ and |.
Related: #1385 covers the same shell: true pattern in sentry init's local-ops.ts.
Activity
linear-code commentedon Nov 27, 2026
MCP-1300