Skip to content
RCE Advisory Intermediate CVE-2020-17023

Visual Studio JSON Remote Code Execution Vulnerability (CVE-2020-17023)

Visual Studio Code would execute attacker-specified code when a user opened a malicious package.json file. An attacker could run arbitrary code in the context of the current user by convincing them to clone a repository and open it.

Justin Steven Follow

Originally disclosed on Microsoft

High 7.8 View original

Description

A remote code execution vulnerability exists in Visual Studio Code when a user is tricked into opening a malicious 'package.json' file. An attacker who successfully exploited the vulnerability could run arbitrary code in the context of the current user. If the current user is logged on with administrative user rights, an attacker could take control of the affected system. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights. To exploit this vulnerability, an attacker would need to convince a target to clone a repository and open it in Visual Studio Code. Attacker-specified code would execute when the target opens the malicious 'package.json' file. The update address the vulnerability by modifying the way Visual Studio Code handles JSON files.

Visual Studio

Visual Studio

Issuing CNA

Microsoft

The original report as published on the Microsoft Security Response Center, by Justin Steven ( @justinsteven ). Images and videos are our own copies; raw HTML is shown as text. View it on Microsoft Security Response Center.

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, Visual Studio Code did not safely handle certain content in JSON files, allowing code execution when the file was opened.

Impact

An attacker could run arbitrary code as the current user, and if that user had administrative rights, could take control of the system, install programs, view or change data, or create accounts with full rights.

What the attacker needed

Victim clones a malicious repository; victim opens it in Visual Studio Code; victim opens the malicious package.json

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 is a popular code editor. A file called package.json is normally used to list a project's settings and dependencies. Here, opening a specially crafted package.json caused the editor to run code chosen by an attacker, so simply opening a project could let someone else run programs on your computer.

What is RCE?

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

More from Microsoft

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.