Fix command injection in sign-in URL opener#3
Fix command injection in sign-in URL opener#3sterlingcrispin wants to merge 1 commit intorohunvora:mainfrom
Conversation
rohunvora
left a comment
There was a problem hiding this comment.
This fixes the obvious shell interpolation on macOS/Linux, but the Windows branch is still passing the server-returned URL through cmd /c start in scripts/signin.ts. That means untrusted input still reaches cmd.exe, which treats characters like &, |, and ^ as command operators, so the command-injection issue remains on Windows.
The new http:/https: check is a good guardrail, but it does not neutralize cmd metacharacters. I would avoid cmd.exe entirely for the Windows opener path, or escape the full Windows command metacharacter set before invoking start.
|
Thanks for the contribution. I reproduced the issue, but I've landed a maintainer patch that fixes the browser-opening path without routing the returned URL through a shell. That supersedes this PR's goal and avoids the remaining Windows issue, so I won't be merging this branch. |
Summary
spawn(...)Security
This fixes the client-side command injection risk in
scripts/signin.ts, where the script previously passed a server-returned URL throughexecSync(...).Validation
scripts/signin.tswithesbuildto confirm the updated code parses cleanly