Skip to content
Access control Advisory Advanced CVE-2026-40376

Visual Studio Code Elevation of Privilege Vulnerability (CVE-2026-40376)

Visual Studio Code did not properly validate input, letting an unauthorised attacker over a network elevate privileges. A successful attacker could obtain the permissions of the MCP Server's managed identity and act on any resources that identity can reach.

Adrian Frei Follow

Originally disclosed on Microsoft

High 7.5 View original

Description

Improper input validation in Visual Studio Code allows an unauthorized attacker to elevate privileges over a network.

FAQ

What privileges could be gained by an attacker who successfully exploited the vulnerability? A successful attacker could obtain the permissions associated with the MCP Server’s managed identity. This may allow the attacker to access or perform actions on any resources that the managed identity is authorized to reach. The attacker does not gain broader tenant‑level or administrator permissions; only those tied to the compromised managed identity.

FAQ

According to the CVSS metric, the attack complexity is high (AC:H). What does that mean for this vulnerability? Successful exploitation of this vulnerability requires an attacker to take additional actions prior to exploitation to prepare the target environment.

Visual Studio Code

Visual Studio Code

Microsoft

Microsoft

Customer Action Required

Yes

The original report as published on the Microsoft Security Response Center, by Adrian Frei. 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

Impact

An attacker could obtain the permissions of the MCP Server's managed identity and access or act on resources that identity is authorised to reach, but not broader tenant-level or administrator permissions.

What the attacker needed

Attacker can reach the target over a network; attacker prepares the target environment first

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.

Input validation means checking that data coming into a program is in the expected form. Here the editor failed to do that properly, so someone on the network could make it do things with higher permissions than they should have. The permissions gained belong to a 'managed identity', which is a cloud account a service uses to talk to other resources.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from Microsoft

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.