A workspace-configured remote agent can turn VS Code path handling into code execution

2026-11-29来源 dev.toEnglish

A workspace-configured remote agent can turn VS Code path handling into code execution

Visual Studio Code can connect to remote agent hosts configured by a workspace. CVE-2026-102238 affects versions from 1.0.0 before 1.141.1. Microsoft describes the issue as improper limitation of a pathname to a restricted directory, also known as path traversal, and rates it critical. The network attack requires user interaction, but the affected component can execute code.

The practical risk is not that every source file is dangerous. It is that opening or trusting a workspace can apply connection settings that influence how the remote agent fetches, writes, or executes files. A developer who thinks the action starts a safe remote session may cross a path boundary before the UI presents a useful warning.

Workspace trust should cover connection configuration

Workspace trust systems often focus on tasks, debuggers, and extension activation. A remote host setting, helper binary, or workspace-provided path is another executable boundary. Treat connection metadata as security-sensitive configuration. Show the host, transport, executable, and filesystem path before the first connection, and do not silently accept changes from an untrusted folder.

A path check must operate on the normalized resolved path, not a string prefix. Remote paths may use different separators and canonicalization rules. The client should receive a fixed capability or opaque file identifier from the remote agent rather than an unrestricted path supplied by the workspace.

Patch and inspect trust decisions

Update Visual Studio Code to 1.141.1 or later. Check desktop, web, and managed installations separately. If an organization pins an older version for extension compatibility, use the vendor's supported mitigation and restrict untrusted workspace opening rather than assuming the risk can be accepted safely.

Review recent workspaces opened from external archives, pull requests, shared folders, or links. Search logs for remote agent connections to hosts that are not on the approved list. Check the remote host for unexpected process creation, file writes, and outbound connections around the session time.

If code execution is suspected, treat developer credentials as exposed. Rotate source control tokens, cloud session credentials, package publishing tokens, SSH agent keys, and signing credentials available to the editor session. Review repository changes made during the window.

Reduce remote-agent authority

Run remote agents in a dedicated development environment with a minimal identity. Do not reuse a personal workstation account with access to every repository and cloud account. Mount only the intended workspace, and keep host credentials out of the remote filesystem.

Require signed or centrally approved connection configurations. Block arbitrary host values in managed settings where possible. Log the destination, workspace hash, agent version, and trust decision so an investigation can distinguish a user-approved host from a configuration change.

Limits

The CVE record establishes network reachability, user interaction, path traversal, and code execution potential. It does not identify every connection workflow or show that a public exploit was used. The response should focus on update status, workspace trust, and remote-host identity.

References

原文:https://www.a8q9.cn/en/article/a-workspace-configured-remote-agent-can-turn-vs-code-path-handling-into-code-exe-3f24da.html

相关文章