fix: handle spaces in process.execPath on Windows @W-23997746@ - #1388
Open
WillieRuemmele wants to merge 4 commits into
Open
fix: handle spaces in process.execPath on Windows @W-23997746@#1388WillieRuemmele wants to merge 4 commits into
WillieRuemmele wants to merge 4 commits into
Conversation
Use Node.js's argv0 spawn option to pass a quoted process.execPath into the command line on Windows when the path contains spaces. This separates executable resolution (unquoted path for lpApplicationName) from command-line construction (quoted for correct argv parsing in the child process). Retains windowsVerbatimArguments to preserve the existing security property of preventing argument injection. Closes #1387
WillieRuemmele
force-pushed
the
wr/fixSpawnExecPathSpaces
branch
from
August 26, 2026 14:41
2fee43c to
c34c18e
Compare
Source-level assertion ensures windowsVerbatimArguments: true cannot be removed without breaking tests (prevents P1 RCE regression). Behavioral test verifies shell metacharacters are never interpreted.
- Use metacharacter payloads without spaces (windowsVerbatimArguments passes args verbatim so spaces cause CRT to split them) - Skip bash-specific test on Windows (no shell association for extensionless scripts)
The `latest` node-version now resolves to Node 26.8.0-alpha on GitHub Actions runners, which fails yarn's engine check. Use lts/* (Node 22) to match the sf-integration-tests job.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
windowsVerbatimArguments: truefromcpSpawnoptions — this flag prevented Node.js from properly escaping the executable path in the spawned command line.jsmodule path (no longer needed without verbatim mode)C:\Program Files\nodejs\node.exe), the unquotedprocess.execPathwas split at the space byCreateProcessW's command-line parser, causingplugins:install/uninstall/updateto fail with a misleading "does not exist in the registry" errorFixes #1387
Work Item
@W-23997746@
Proof of Work
Test plan
process.execPathsymlinked to a path with spaces correctly spawns the .js moduleC:\Program Files\nodejs\(requires Windows environment)