Skip to content
Path traversal Advisory Advanced CVE-2026-78461

Visual Studio Code Security Feature Bypass Vulnerability (CVE-2026-78461)

Visual Studio Code fails to properly restrict a pathname to a restricted directory, which lets an attacker bypass the Workspace Trust feature. An attacker could then get content from an untrusted workspace to run commands or code without the user granting trust, and by escaping the sandbox read local files.

Tarek Nakkouch Follow

Originally disclosed on Microsoft

High 7.4 View original

Description

Improper limitation of a pathname to a restricted directory ('path traversal') in Visual Studio Code allows an unauthorized attacker to bypass a security feature over a network.

FAQ

What security feature could be bypassed by successfully exploiting this vulnerability? An attacker who successfully exploited this vulnerability could bypass the Visual Studio Code Workspace Trust feature, allowing content from an untrusted workspace to run commands or code without the user first granting trust. See Workspace Trust for more information.

FAQ

What type of information could be disclosed by this vulnerability? The type of information that could be disclosed if an attacker successfully exploited this vulnerability by escaping the sandbox, is the ability to read local files.

Visual Studio Code

Visual Studio Code

Microsoft

Microsoft

Customer Action Required

Yes

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

Root cause

Likely a path traversal flaw: a pathname is not properly limited to its restricted directory, so a crafted path escapes the intended sandbox and the trust check.

Impact

An attacker could bypass Workspace Trust so untrusted workspace content runs commands or code without approval, and could escape the sandbox to read local files.

What the attacker needed

Victim opens an untrusted workspace

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.

Workspace Trust is a safety prompt in Visual Studio Code that asks whether you trust a folder before it runs things like build tasks or extensions. Because of a flaw in how file paths are checked, a malicious workspace can slip past that prompt and run code as if you had approved it. The same flaw can also let it reach files outside its sandbox, which is the isolated area it is meant to stay inside.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by Tarek Nakkouch

View all

5 more disclosed reports, best first.

More from Microsoft

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.