Somebody sent me this blog my way today so I had a dig into it for a few hours. https://medium.com/@amitassaraf/the-story-of-extensiontotal-how-we-hacked-the-vscode-marketplace-5c6e66a0e9d7

Yes, Amit is right. Visual Studio Marketplace is a clusterfuck.

✅ anybody can verify themselves using just a domain name
✅ anybody can set any display name
✅ extensions allow RCE, no sandboxing or limits at all
✅ full access to developer + build
✅ anybody can link any GitHub repo, even if it has nothing to do with the extension
✅ I’ve already found malware - backdoors, beacons etc etc

1/6 | How We Hacked Multi-Billion Dollar Companies in 30 Minutes Using a Fake VSCode Extension

30 minutes. 30 minutes is how long it took us to develop, publish, and polish a Visual Studio Code (The most popular IDE on the planet with over 15m monthly users) extension that changes your IDE’s…

Medium

There's a follow on blog post which is also relevant: https://medium.com/@amitassaraf/2-6-exposing-malicious-extensions-shocking-statistics-from-the-vs-code-marketplace-cf88b7a7f38f

I'm still digging through the extensions myself and there's a lot to unpack, there's essentially supply chain attacks there where people have replaced open source projects and nobody has even noticed.

2/6 | Exposing Malicious Extensions: Shocking Statistics from the VS Code Marketplace

In the previous blog post “1/6 | How We Hacked Multi-Billion Dollar Companies in 30 Minutes Using a Fake VSCode Extension”, we told the story of how within 30 minutes of work we created a Visual…

Medium

A reminder that Visual Studio Code’s marketplace is still an absolute security clusterfuck that Microsoft have engineered.

There’s active supply chain attacks in there nobody has reported on. (That, yes, will get a cartoon porg blog on one day).

Expect many more of these. VSCode is an absolute security trash fire, MS Security needs to have a word with MS.

- It installs as non-admin
- There are no security controls *at all* around marketplace access
- addons update automatically and are required
- No vetting
- Blue tick verification just needs any domain name
- Source code link on addons doesn’t need to match the addons
- Allows RCE by design
- The marketplace is absolutely riddled with malware

https://www.bleepingcomputer.com/news/security/vscode-extensions-with-9-million-installs-pulled-over-security-risks/

VSCode extensions with 9 million installs pulled over security risks

Microsoft has removed two popular VSCode extensions, 'Material Theme - Free' and  'Material Theme Icons - Free,' from the Visual Studio Marketplace for allegedly containing malicious code.

BleepingComputer
1/6 | How We Hacked Multi-Billion Dollar Companies in 30 Minutes Using a Fake VSCode Extension

30 minutes. 30 minutes is how long it took us to develop, publish, and polish a Visual Studio Code (The most popular IDE on the planet with over 15m monthly users) extension that changes your IDE’s…

ExtensionTotal
@GossiTheDog I'm both horrified and amused at how bad this is
@GossiTheDog And the remote extension works by sshing into the target machine (e.g. your production machine), grabbing a binary of VS Code from a Microsoft server, extracting it in he home directory (neatly bypassing any auditing of installed binaries and leaving the executables writeable by the user) and then installing copies of your extensions on the target machine, where they then have the ability to run other executables and make network connections from the target machine.

@GossiTheDog

This whole thing has been on my mind if I want to download a VS Code extension. I'm at a point where if there's a specific need that I think an extension would improve, I ask other devs for recommendations, and use something from someone I trust. This reinforces my fears.

@GossiTheDog oof.

I hope the Obsidian plugin ecosystem is safer than this.

@kboyd @GossiTheDog I can't imagine why it would be.

I filed a bug once against a popular extension, only to discover (a) it had been abandoned by the author, (b) even though the author had gone to work *for* Obsidian, and (c) the shipped code was a compiled JS that had unclear relationship to the TS in the repo.

As well, Obsidian itself is not open source, so unlike VS Code/Codium it's not clear what Electron or other features may be exposed for RCE and other trickery 🙃

@GossiTheDog

It is the Internet Explorer of modern day. Not just for the reasons mentioned, but also because if someone want something they ‘just search and download’ anything.

@GossiTheDog while im certainly that vscode... is ... special... this problem exists in all "modern" editors and ide's, seriously, whos checking the plugins that one could plug into notepad++? also... vundle had its moment, so did plug...
@GossiTheDog i can't wait until Theia IDE can run python fully
@GossiTheDog What a surprise ...... especially since I've learned they also own the NPM repos
@GossiTheDog from the admin side, there's sweet FA you can do to set an allow / block list either

@GossiTheDog I know some corporate workplaces where the easiest way, if not the only way, to download some binary is to get the matching VSCode plugin.

But maybe this is exactly what you're referring to ?

@GossiTheDog https://github.com/microsoft/DevSkim/issues/648 We need a new song… “you have to sign it, sign it…” 😁
binaries are not digitally signed · Issue #648 · microsoft/DevSkim

Describe the bug exe and dll files in .vscode\extensions\ms-cst-e.vscode-devskim-1.0.33\devskimBinaries are not digitally signed. unsigned code is not allowed to run on our machines.

GitHub
@GossiTheDog Please lead us to the knowledge, much interested
@GossiTheDog Last night I was looking at 'code' on my Linux box, thinking I never use it. Thanks for the nudge!
@GossiTheDog Another Problem is that lots of VS-Code extensions contain unsigned DLLs. So it is not easy to harden the developer systems with AppLocker.
@GossiTheDog Shit. Work is going to be fun for a few weeks.
@GossiTheDog This is even more fun considering that VS Code extensions update automatically by default. Publish an extension to gain trust and update to a malicious version at a later date, the auto update will guarantee that you will infect plenty of targets.
@GossiTheDog Given the verification process for Flatpaks include domain validation via hosting a .well-known file and adding attributes to a GitHub repo that you own, I wonder how much easier it is to replicate this with Flatpaks compared to VS Code extensions.
@GossiTheDog @Fr333k
ok but our dev process relies on darcula.
@GossiTheDog
calling them extensions and not plugins seems to only serve to obscure this threat

@GossiTheDog I spent some time earlier today trimming down my extensions as much as I could without impacting my productivity, with the eventual goal in mind of sticking with my own additions as I can.

Not only does it have those security problems, but also most extensions that are recommended are bloated and meaningless. Like how did I over time manage to collect 3 different plugins for Python language servers? And at some point I had a plugin made by Wix, who I have never used their software and never planned to…

@GossiTheDog
Thanks for highlighting this.

I've removed or disabled almost all the extensions I had installed leaving a core of popular ones from official projects (I hope).

I wonder what FOSS alternatives we now have to VSC. I mainly do #RustLang and some web (mostly Svelte it plain HTML) and get a big productivity boon from syntax highlighting/checking and completion. Finding function definitions and references, global search and replace, auto fixing after file rename etc. Gosh, so much!