Uh oh!
There was an error while loading. Please reload this page.
fix: bypass default-browser PATH hijack on Windows for --private @W-23807283@ - #1748
Open
WillieRuemmele wants to merge 4 commits into
Open
fix: bypass default-browser PATH hijack on Windows for --private @W-23807283@#1748WillieRuemmele wants to merge 4 commits into
WillieRuemmele wants to merge 4 commits into
Conversation
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 freeto 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
sf org open --privatecalls thedefault-browsernpm package which invokes barereg(no fully-qualified path), allowing a malicious repo-localreg.exeto execute via PATH hijackdefault-browserentirely on Windows by detecting the default browser ourselves using a fully-qualified%SYSTEMROOT%\System32\reg.exepath, then passing an explicit app name + incognito flag toopen()(which skipsdefault-browserfor any concrete app name)wsl-utils'spowerShellPath()which already qualifies system binary pathsWork Item
@W-23807283@: SF CLI - Project-local reg.exe leads to RCE during private org opening
Test plan
getWindowsPrivateBrowserApp()covering Chrome, Firefox, Edge, Brave, hyphen-suffixed ProgIds, unsupported browsers, and unparseable outputreg.exenode_modules/.bin/reg.cmd