microsoft / microsoft/vscode-sudo-prompt

Not working on Windows if the username contains quotes

Open Beginner friendly
#5 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.