microsoft / microsoft/vscode-sudo-prompt
Not working on Windows if the username contains quotes
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 8
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
Privilege elevation with this library does not work on Windows when the user name contains quotes (e.g: It's me).
By patching the library locally I found changing this line makes it work:
- command.push('"\'' + instance.pathExecute.replace(/'/g, "`'") + '\'"');
+ command.push('"\'' + instance.pathExecute.replace(/'/g, "''") + '\'"');
However I'm not sure about other impacts this change may have.
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
Locate the command.push call that formats instance.pathExecute and compare its quoting behavior on Windows. Reproduce privilege elevation with a username containing an apostrophe, then verify that it succeeds without changing behavior for usernames without quotes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100