Visual Studio Code Remote Code Execution Vulnerability (CVE-2026-102238)
Visual Studio Code had a path traversal flaw in how it limited file paths to a restricted directory. An attacker could convince a user to import a crafted profile or open crafted content or links, bypass path-containment checks and potentially execute code as the user.
Originally disclosed on Microsoft
Description
Improper limitation of a pathname to a restricted directory ('path traversal') in Visual Studio Code allows an unauthorized attacker to execute code over a network.
FAQ
How could an attacker exploit this vulnerability? An attacker could convince a user to import a specially crafted Visual Studio Code profile or open specially crafted content or links. Successful exploitation could bypass path-containment checks, allowing access outside intended locations and potentially resulting in code execution in the context of the user.
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 did not correctly normalise or validate file paths before using them, so a crafted path could escape the intended directory.
Impact
An attacker could potentially execute code in the context of the user, though the advisory does not state that exploitation was demonstrated.
What the attacker needed
Victim imports a crafted profile; or opens crafted content or links
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 path traversal bug lets someone make a program reach files or folders it should not be allowed to touch, by using a path that sneaks past the intended boundary. Here, opening or importing something malicious in Visual Studio Code could let an attacker get past those boundaries and run their own code on the victim's computer. The advisory does not give the technical details of how the bypass works.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.