Skip to content

Visual Studio Code MCP gallery metadata path traversal

Moderate
vritant24 published GHSA-g6p5-6xp8-5jwg Sep 8, 2026

Software

Visual Studio Code

Affected versions

>= 1.0.0, < 1.136.2

Patched versions

1.136.2

Description

Impact

A path traversal vulnerability in Visual Studio Code's Model Context Protocol (MCP) server management could allow attacker-controlled gallery or registry metadata to redirect file operations outside the intended per-server storage location.

Visual Studio Code used an MCP server's name and version to construct its metadata directory without sufficiently validating the resulting path. Installing or updating a server with malicious metadata could overwrite another installed server's manifest.json or README.md, or write files outside the MCP storage directory.

Uninstalling an affected server entry could also cause an unintended directory to be recursively deleted.

Exploitation requires user interaction, such as installing or updating an MCP server whose gallery or registry metadata is controlled by an attacker.

Patches

The fix is available starting with Visual Studio Code 1.136.2.

The fix (6a88486) validates that the resolved metadata path represents a single directory component within the MCP storage directory. It also verifies that an uninstall target matches the location derived from that specific server's name and version before allowing deletion.

Users should update to Visual Studio Code 1.136.2 or later.

Workarounds

Do not install or update MCP servers from untrusted galleries or registries. Avoid servers whose publisher or registry source cannot be trusted.

These precautions reduce exposure but are not a substitute for updating Visual Studio Code.

References

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N

CVE ID

CVE-2026-81377

Weaknesses

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. Learn more on MITRE.