Skip to content
RCE Advisory Intermediate CVE-2020-16977

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

The Visual Studio Code Python extension mishandled the rendering of Jupyter notebook content, allowing a crafted notebook file to execute arbitrary code. An attacker who convinced a user to open such a file could run code with the user's privileges.

Johann Rehberger Follow with pizzacat83

Originally disclosed on Microsoft

High 7.0 View original

Description

A remote code execution vulnerability exists in Visual Studio Code when the Python extension loads a Jupyter 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 addresses the vulnerability by modifying the way Visual Studio Code Python extension renders notebook content.

Issuing CNA

Microsoft

The original report as published on the Microsoft Security Response Center, by Johann Rehberger of WUNDERWUZZI, LLC. 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 rendered notebook content in a way that allowed embedded code to execute without adequate isolation.

Impact

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

What the attacker needed

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

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 is a document that can contain code and text. The Python add-on for the code editor did not safely handle these files, so a malicious notebook could run harmful commands on the computer when opened. The attacker only needed the victim to open the file.

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.