microsoft / microsoft/vscode-test
runTest.js triggers Node DEP0190 by passing args with shell: true
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 316
- Forks
- 73
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 3
Description
Environment
- Windows 11
- Node.js v26.5.0
@vscode/test-electron2.5.2 (via@vscode/test-cli0.0.10)
Problem
Every vscode-test run prints a Node deprecation warning before anything else:
(node:5828) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Cause
out/runTest.js:
async function innerRunTests(executable, args, testRunnerEnv) {
const fullEnv = Object.assign({}, process.env, testRunnerEnv);
const shell = process.platform === 'win32';
const cmd = cp.spawn(shell ? `"${executable}"` : executable, args, { env: fullEnv, shell });
Passing a non-empty args array together with shell: true is exactly the pattern Node deprecates as DEP0190.
Suggestion
Spawn without a shell (resolve the actual .exe / .cmd and pass args directly), or otherwise escape/concatenate the arguments explicitly. On Windows the arguments here include paths that may contain spaces (--extensionDevelopmentPath=..., --user-data-dir=...), so dropping shell: true and quoting is the safer route.
This may also be related to #361: in both cases the spawned CLI process does not behave as expected on Windows when it lives on a different drive than the profile directories.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with out/runTest.js, especially innerRunTests and its child-process spawn call, then reproduce a vscode-test run on Windows with arguments containing paths. Compare the available process-launch behavior and verify that the completed change no longer emits DEP0190 while still handling executable and profile paths on different drives.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- devtools, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100