The Real Risk of Malicious VS Code Extensions and How to Reduce It

A VS Code extension runs with the same permissions as the developer who installs it. It can read source code, environment files, SSH keys and cloud credentials, run commands and connect to the internet. A malicious or hijacked extension is therefore as dangerous as running an unknown program, and developer machines hold some of the most valuable secrets in a company.

Jul 15, 2025 - 14:33
Updated: 
106.7k

Cyber Threats, Scams & Online Safety in Cybersecurity & Ethical Hacking · Explainer

The Real Risk of Malicious VS Code Extensions and How to Reduce It

Quick answer: A VS Code extension runs with the same permissions as the developer who installs it. It can read source code, environment files, SSH keys and cloud credentials, run commands and connect to the internet. A malicious or hijacked extension is therefore as dangerous as running an unknown program, and developer machines hold some of the most valuable secrets in a company. In July 2025 Kaspersky described a fake "Solidity" extension on the Open VSX marketplace, used by Cursor and other VS Code forks, that led to about $500,000 in cryptocurrency being stolen from a developer. Reduce the risk by allowlisting extensions, vetting publishers, using Workspace Trust, and keeping secrets off developer laptops where possible.

Key takeaways

  • Extensions are not sandboxed; they can do anything the user can.
  • VS Code forks such as Cursor, Windsurf and VSCodium use Open VSX, not Microsoft's marketplace.
  • Download counts and ratings can be faked; check the publisher and source repository.
  • Organisations can enforce an allowlist with the extensions.allowed policy.
  • Short-lived credentials limit the damage if an extension is malicious.

Table of Contents

Why Are Extensions So Risky?

The VS Code documentation states that extensions run with the same permissions as VS Code itself. That means access to:

Asset on a developer machineWhy attackers want it
Source codeIntellectual property, hidden secrets, places to insert backdoors
.env files, cloud CLI credentialsDirect access to production systems
SSH and Git tokensPush malicious code to repositories
Crypto wallets and browser dataDirect financial theft
Corporate VPN sessionA foothold inside the network

This is a software supply chain risk, catalogued by MITRE as T1195.002.

How Do Malicious Extensions Get Installed?

  • Impersonation: a copy of a popular extension with the same name and icon.
  • Ranking manipulation: inflated downloads and fresh update dates push the fake above the real one.
  • Account takeover: a legitimate publisher's account is compromised and a malicious update is pushed.
  • Abandoned projects: a popular extension is sold or handed to a new, malicious owner.
  • Recommendations in AI tools or tutorials pointing to the wrong package.

What Happened in the Cursor Incident?

According to Kaspersky's report, a blockchain developer installed an extension named "Solidity Language" from Open VSX into Cursor. It provided none of its advertised features. Instead it downloaded scripts that installed remote access software and an information stealer, and the developer lost about $500,000 in crypto. The fake ranked above the genuine extension. The full timeline and indicators are in our post on the Cursor extension supply chain attack.

How Do You Vet an Extension?

  1. Check the publisher name exactly and look for a verified publisher badge.
  2. Open the linked source repository; confirm it exists, is active and matches the package.
  3. Compare with the official project's install instructions.
  4. Be suspicious of very new packages with huge download counts.
  5. Read the requested activation events and contributed commands.
  6. Prefer fewer extensions; remove ones you no longer use.
# List installed extensions with versions (VS Code; Cursor has a similar CLI)
code --list-extensions --show-versions

# Remove an extension
code --uninstall-extension publisher.extension-name

What Controls Should Organisations Use?

ControlHow
Extension allowlistThe extensions.allowed policy in VS Code enterprise settings
Workspace TrustOpen unknown repositories in Restricted Mode
SecretsShort-lived cloud credentials via SSO; no long-lived keys in .env files
IsolationDev containers or cloud workspaces for risky projects
InventoryCollect installed extension lists from endpoints, like an SBOM for tools
EDR on developer machinesDevelopers are high-value targets, not exceptions

How Do You Detect a Bad Extension?

  • The editor spawning PowerShell, curl or wget unexpectedly.
  • Remote access tools such as ScreenConnect appearing without IT approval.
  • Outbound connections from the editor to unknown domains.
  • Extension features that simply do not work.

If you suspect one, disconnect, remove the extension, rotate every credential the machine held, and report it to the marketplace. WebAsha offers secure development training. See also supply chain security practices.

References

Frequently Asked Questions

Yes. Extensions run with the user’s permissions, so a malicious one can read files, credentials and code and send them out.

No. The VS Code documentation says extensions run with the same permissions as VS Code, so treat them like installed software.

An open source extension registry run by the Eclipse Foundation and used by VS Code forks such as Cursor and VSCodium.

Attackers inflate download counts and publish frequent updates so search ordering places the fake extension above the genuine one.

Use the extensions.allowed policy to permit only approved extensions or publishers, and collect extension inventories from endpoints.

A VS Code feature that opens unfamiliar folders in Restricted Mode, limiting tasks, debugging and some extension features.

Disconnect, uninstall it, scan the machine, rotate every credential it could access, and report the extension to the marketplace.

Confirm the exact publisher, a verified badge and an active linked source repository that matches the official project instructions.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.