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.
Topic: Cyber Threats, Scams & Online Safety in Cybersecurity & Ethical Hacking · Explainer
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?
- How Do Malicious Extensions Get Installed?
- What Happened in the Cursor Incident?
- How Do You Vet an Extension?
- What Controls Should Organisations Use?
- How Do You Detect a Bad Extension?
- References
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 machine | Why attackers want it |
|---|---|
| Source code | Intellectual property, hidden secrets, places to insert backdoors |
| .env files, cloud CLI credentials | Direct access to production systems |
| SSH and Git tokens | Push malicious code to repositories |
| Crypto wallets and browser data | Direct financial theft |
| Corporate VPN session | A 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?
- Check the publisher name exactly and look for a verified publisher badge.
- Open the linked source repository; confirm it exists, is active and matches the package.
- Compare with the official project's install instructions.
- Be suspicious of very new packages with huge download counts.
- Read the requested activation events and contributed commands.
- 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?
| Control | How |
|---|---|
| Extension allowlist | The extensions.allowed policy in VS Code enterprise settings |
| Workspace Trust | Open unknown repositories in Restricted Mode |
| Secrets | Short-lived cloud credentials via SSO; no long-lived keys in .env files |
| Isolation | Dev containers or cloud workspaces for risky projects |
| Inventory | Collect installed extension lists from endpoints, like an SBOM for tools |
| EDR on developer machines | Developers 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
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0