Visual Studio Code Elevation of Privilege Vulnerability (CVE-2025-26631)
Visual Studio Code has an uncontrolled search path element that lets an authorised local attacker elevate privileges to SYSTEM. The attacker must send a malicious file and convince the user to open it.
Originally disclosed on Microsoft
Description
Uncontrolled search path element in Visual Studio Code allows an authorized attacker to elevate privileges locally.
FAQ
What privileges could be gained by an attacker who successfully exploited this vulnerability? An attacker who successfully exploited this vulnerability could gain SYSTEM privileges.
FAQ
According to the CVSS metric, user interaction is required (UI:R) and privileges required is low (PR:L). What does that mean for this vulnerability? An authorized attacker must send the user a malicious file and convince the user to open it.
Visual Studio Code
Visual Studio Code
Microsoft
Microsoft
Customer Action Required
Yes
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 application searches for a required file or library using a path that includes a location an attacker can write to, so a malicious file placed there is loaded instead of the legitimate one.
Impact
An attacker who successfully exploited this vulnerability could gain SYSTEM privileges, but the user must open a malicious file.
What the attacker needed
Authorised local access; victim opens a malicious 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.
When a program loads a file, it sometimes searches several folders in order. If an attacker can place a malicious file in a folder that is checked before the real one, the program may run the attacker's file instead. Here, that mistake in Visual Studio Code could let someone with normal access gain the highest Windows privileges, but only if the user opens a file the attacker sends.
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.