Visual Studio Code Remote Code Execution Vulnerability (CVE-2026-120779)
Visual Studio Code contains a code injection flaw in how it handles remote MCP servers. An unauthenticated attacker who controls a malicious MCP server could convince a user to connect and click a crafted notification link, leading to code execution with the user's permissions.
Originally disclosed on Microsoft
Description
Improper control of generation of code ('code injection') in Visual Studio Code allows an unauthorized attacker to execute code over a network.
FAQ
How could an attacker exploit this vulnerability? An unauthenticated attacker who controls a remote MCP server could convince a user to connect Visual Studio Code to that server and click a specially crafted link in a notification. Successful exploitation could allow the attacker to execute code with the user's permissions.
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 improper neutralisation of user-supplied input in notification links, allowing code injection when connected to a remote MCP server.
Impact
Successful exploitation could allow the attacker to execute code with the user's permissions.
What the attacker needed
Attacker controls a remote MCP server; victim connects VS Code to that server; victim clicks a crafted notification link
How it was found
- An attacker controls a remote MCP server.
- The attacker convinces a user to connect Visual Studio Code to that server.
- The attacker sends a notification with a specially crafted link.
- The user clicks the link, leading to code execution.
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. It can connect to remote helper servers called MCP servers. This report says a malicious helper server could trick the editor into running harmful code if the user clicks a link in a notification. The attacker needs the user to connect to their server and click the link.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.