Skip to content
RCE Advisory Intermediate

Microsoft Visual Studio Code URL Command Injection Remote Code Execution Vulnerability

The vscode URI handler built a system call from a user-supplied string, so a crafted URI could run arbitrary commands. An attacker could execute code as the current user at medium integrity if the target visited a malicious page or opened a malicious file.

rgod Follow

Originally disclosed on Zero Day Initiative

Medium 6.8 View original

This vulnerability allows remote attackers to execute arbitrary code on vulnerable installations of Microsoft Visual Studio Code. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.

rgod, on the Zero Day Initiative

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the vscode URI handler passed user-controlled URI content into a system call without sanitising it, allowing command injection.

Impact

An attacker could execute arbitrary code under the context of the current user at medium integrity, but only if the target visited a malicious page or opened a malicious file.

What the attacker needed

Victim opens a malicious page or file

The fix

The issue was addressed in the 1.19.2 release of Visual Studio Code.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Visual Studio Code can be opened from a link that starts with a special vscode prefix. The program took part of that link and passed it to the operating system as a command without checking it, so a booby-trapped link could make the computer run the attacker's commands. The user had to open such a link or file for this to happen.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by rgod

View all

696 more disclosed reports, best first.

More from Zero Day Initiative

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.