Visual Studio Code Remote Code Execution Vulnerability (CVE-2026-121662)
Visual Studio Code did not properly neutralise special elements used in a command, allowing command injection. An attacker could convince a user to open a crafted workspace and execute code locally, bypassing Workspace Trust without the user granting trust.
Description
Improper neutralization of special elements used in a command ('command injection') in Visual Studio Code allows an unauthorized attacker to execute code locally.
FAQ
How could an attacker exploit this vulnerability? An attacker could convince a user to open a specially crafted Visual Studio Code workspace. Successful exploitation could bypass Workspace Trust protections and allow attacker-controlled content to execute code in the context of the user. User interaction is required, but the user does not need to grant trust.
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 failed to neutralise special command elements in workspace-controlled input, so crafted content could be executed as a command before Workspace Trust was enforced.
Impact
An attacker could execute code locally in the context of the user, bypassing Workspace Trust protections, though user interaction is required.
What the attacker needed
Victim opens a crafted workspace; user interaction required
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 code editor. It has a safety feature called Workspace Trust that asks whether you trust a folder before running its settings. This bug let a malicious workspace run commands on your computer even though you never said you trusted it.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.