Skip to content
RCE Advisory Intermediate CVE-2020-1192

Visual Studio Code Python Extension Remote Code Execution Vulnerability (CVE-2020-1192)

The Visual Studio Code Python extension loaded workspace settings from a notebook file in a way that let those settings run code. An attacker who convinced a user to open a crafted notebook could run arbitrary code as that user.

Ron Masas Follow

Originally disclosed on Microsoft

Critical View original

Description

A remote code execution vulnerability exists in Visual Studio Code when the Python extension loads workspace settings from a notebook 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 open a specially crafted file in Visual Studio Code with the Python extension installed. The update address the vulnerability by modifying the way Visual Studio Code Python extension enforces user settings.

Visual Studio

Visual Studio

Microsoft

Microsoft

Customer Action Required

Yes

The original report as published on the Microsoft Security Response Center, by Ron Masas. 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 the Python extension applied workspace settings from a notebook without properly restricting them, so settings could trigger code execution.

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, change or delete data, or create accounts with full rights.

What the attacker needed

Visual Studio Code with the Python extension; victim opens a crafted notebook file

How it was found

  1. Create a specially crafted notebook file containing malicious workspace settings.
  2. Convince the target to open that file in Visual Studio Code with the Python extension installed.
  3. The extension loads the settings and runs the attacker's code as the current user.

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.

A notebook file can carry settings that tell the Python extension how to behave. The extension trusted those settings too much, so a booby-trapped notebook could make the editor run the attacker's code on your computer. You would have to open the file yourself, but after that the code runs with your own permissions.

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 Ron Masas

View all

3 more disclosed reports, best first.

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.