Microsoft VS Code Remote-SSH Extension Hacked to Execute Malicious Code on Developer’s Machine

Microsoft VS Code Remote-SSH Extension Hacked to Execute Malicious Code on Developer’s Machine

A critical security vulnerability has been discovered in Microsoft’s VS Code Remote-SSH extension that allows attackers to execute malicious code on developers’ local machines through compromised remote servers. 

Security researchers have demonstrated how this attack, dubbed “Vibe Hacking,” exploits the inherent trust relationship between remote development environments and local machines, affecting both VS Code and popular forks like Cursor.

The vulnerability stems from a dangerous misconception among developers who believe remote development environments provide complete isolation. 

Google News

Key Takeaways
1. VS Code Remote-SSH extension allows attackers to execute malicious code on developers' local machines.
2. Attackers use built-in commands to open local terminals and automatically run arbitrary code.
3. Exposing their workstations to compromise when connecting to untrusted servers.

However, once a server is compromised, attackers can easily pivot to the developer’s local machine through the Remote-SSH extension’s built-in functionality.

Exploiting Built-in Commands

Calif reports that the attack leverages two specific VS Code commands that operate within the default configuration settings. 

Malicious extensions on compromised servers can execute the workbench.action.terminal.newLocal command to open a terminal directly on the developer’s local machine, bypassing the remote environment entirely.

Attack Chain
Attack Chain

Once the local terminal is established, attackers deploy the workbench.action.terminal.sendSequence command to send arbitrary text sequences to the terminal. 

By appending a newline character, the malicious code executes automatically as if the developer pressed Enter. This technique effectively transforms the trusted development environment into a command and control channel, reads the report.

The attack works seamlessly because the Remote-SSH extension inherently trusts communications from the remote server. 

When developers connect to what they believe is an isolated sandbox environment, they unknowingly expose their local machines to potential compromise.

Mitigation Strategies

Microsoft has acknowledged these risks on the Remote-SSH extension marketplace page, warning that “a compromised remote could use the VS Code Remote connection to execute code on your local machine”. 

However, this warning has not prevented widespread adoption of remote development practices, particularly for AI agent deployment and testing.

Security researchers suggest implementing user approval mechanisms when remote extensions attempt to open local terminals or send keystrokes to active terminals. 

Monitoring the ~/.cursor-server directory for unauthorized changes can provide limited protection, though this approach offers minimal security if servers are fully compromised.

The vulnerability highlights the need for secure-by-default designs in development tools that don’t rely on users making complex trust decisions. 

As remote development continues growing in popularity, addressing these fundamental security issues becomes increasingly critical for protecting developer workstations from sophisticated supply chain attacks.

Safely detonate suspicious files to uncover threats, enrich your investigations, and cut incident response time. Start with an ANYRUN sandbox trial → 


Source link

About Cybernoz

Security researcher and threat analyst with expertise in malware analysis and incident response.