Blog header

Safe troubles with VSCode and Microsoft

5 min read

Monday, April 29, 2024

Safe troubles with VSCode and Microsoft

Visual Studio Code (VSCode) is an Integrated Developer Environment (IDE) that is widely used by developers. A recent survey conducted by StackOverflow revealed that a staggering 74.48% of developers prefer using VSCode, making it the most popular IDE in demand.

Almost unrecognizable extensions

Unfortunately, here is a new potential risk that has come to light, which targets the Visual Studio Code extensions marketplace. This attack vector allows for the uploading of rogue extensions that pretend to be legitimate ones. The goal of such attacks is to carry out what is known as a supply chain attack. According to a report by Aqua security researcher Ilay Goldman, this technique could serve as an entry point for attacking multiple organizations.

The VSCode Marketplace offers over 40,000 extensions, which provide various functionalities to help developers code more efficiently. These extensions can integrate debuggers for specific programming languages and facilitate the deployment of code artifacts to production. Some examples of popular extensions include Jupyter with 52 million installations and Prettier with 27 million installations. With such a vast number of extensions available, it becomes challenging for even security-conscious developers to distinguish between malicious and benign extensions. Complicating matters further is the fact that anyone can create a user account, even with a temporary email, and publish an extension on the Marketplace!

Aqua's research revealed that cybercriminals can not only imitate popular extensions with slight changes to the URL but can also use the same extension name and publisher data, including information from a project repository. Moreover, the verification badge assigned to authors can be easily bypassed since it only confirms that the extension publisher owns a domain.

One critical point to consider is that all extensions in VSCode run with the user's privileges who has opened the software, without any sandboxing. This means that an extension can install any program on your computer, including ransomware and destructive software. It can access and modify all the code you have locally, and even use your SSH key to modify code in your organization's repositories on GitHub.

  • May 9, 2024

AI Failures: Why AI Projects Crash and Burn?

Typosquatting as a big hacking chance

In other words, a malicious actor could purchase any domain, register it to obtain a verified check mark, and then upload a trojanized extension with the same name as a legitimate one to the marketplace. While there have been numerous reports of malicious packages being uploaded to popular package managers like NPM and PyPI, there is limited information available about malicious VSCode extensions. One such threat is called masquerading, where an extension is created to resemble a popular one, with the sole purpose of tricking unsuspecting developers into downloading it. Attackers often employ a technique known as typosquatting, which involves making slight variations in the URL, such as omitting a letter or transforming one letter into another, to deceive developers.

Can I trust extensions from the Marketplace?

Microsoft has provided guidelines on how to determine if a VSCode extension is trustworthy. The VSCode Marketplace uses a blue check mark (√) near the author's name to indicate verification. However, it's important to note that this check mark only signifies that the publisher has proven ownership of a domain, which can be any domain. In reality, a publisher can buy any domain and register it to obtain the verified check mark.

It's worth mentioning that VSCode extensions are written in Node, and the packages are downloaded from NPM. Therefore, there is also a constant threat of malicious code packages being uploaded to package managers like NPM.

In conclusion, while Visual Studio Code is a highly popular IDE, developers need to be cautious when installing extensions from the marketplace. It can be challenging to distinguish between legitimate and malicious extensions, and attackers can exploit this vulnerability to infiltrate organizations' supply chains.

Share