Live data from Hacker News

Threat actors expand abuse of Microsoft Visual Studio Code

jamf.com

231–240 of 306 posts

Re: Threat actors expand abuse of Microsoft Visual Studio Code

#231

Earlier quoted context omitted.

The indexer was probably clangd, not Code itself.

IME more likely cpptools (which comes with vscode) than clangd. Relevant: https://news.ycombinator.com/item?id=43788332

That's correct. Clangd doesn't churn nearly as hard as cpptools, but it's also not nearly as good as cpptools.

Re: Threat actors expand abuse of Microsoft Visual Studio Code

#232

In VS Code settings search for "tasks" you will find "Task: Allow Automatic Tasks"...turn it off. Anything else that should be locked down?

1. Uninstall VSCode 2. Install Vim / Emacs / Sublime / Helix 3. ???? 4. Profit

> Helix

I'm not sure about the other ones, but I know that helix supports language servers by default and it does not have a workspace trust system like vscode, so LSPs can automatically execute code when you enter a directory

https://github.com/helix-editor/helix/issues/9514#issuecomme...

So uninstalling VSCode would be a bit of a step back in that case

Re: Threat actors expand abuse of Microsoft Visual Studio Code

#233
post #77

Earlier quoted context omitted.

Never liked Eclipse, but I’ve been forced to use VSCode over my preferred JetBrains IDEs because it is the only modern mainstream editor with a competent client-server mode. As in, actually rendering the UI locally while doing all the code indexing and intelligence on the server. Corporate world would much rather maintain disposable remote VMs than help you unfuck your laptop after whatever required security upgrade…

Have you tried Jetbrains Gateway? I’m curious whether it’s insufficient or just too recent, as I’ve eyed it a few times.

It’s not as dumb a client as VNC, but it’s close. Basic operations like typing and scrolling will stutter and lag if your connection is less than perfect. VSCode’s client is really VSCode from a UI perspective.

Re: Threat actors expand abuse of Microsoft Visual Studio Code

#234
post #199

VS Code team member here :wave: As called out elsewhere, workspace trust is literally the protection here which is being circumvented. You're warned when you open a folder whether you trust the origin/authors with pretty strong wording. Sure you may find this annoying, but it's literally a security warning in a giant modal that forces you to chose. Even if automatic tasks were disabled by default, you'd still be vuln…

Installing dependencies on folder open is a massive misfeature. I understand that you can't do anything about extensions that also do it but I really hope that you guys see how bad an idea that is for the core editor. "Do I trust the authors of this workspace" is a fundamentally different question than "can I run this code just by looking at it"

Re: Threat actors expand abuse of Microsoft Visual Studio Code

#235
post #169

Earlier quoted context omitted.

I mean it's not in caps, but it's literally the first line in the dialog after the header: https://code.visualstudio.com/docs/editing/workspaces/worksp... I'm big on user first, if that dialog had sirens blaring, a gif and ten arrows pointing that "THIS MAY EXECUTE CODE" and people still didn't get the idea, I'd say it needs fixing. It can't be said that they didn't try or that they hid it though.

>"THIS MAY EXECUTE CODE" So at the end of the day its still unclear whether it executes code or not? Just say "this WILL execute code" and specify exactly which code it tries to execute by default.

I don't know about you people, but I always read this as "it may execute code if you run a build step".

Not "I will execute autorun.inf like an idiot."

And NO. I do not want my IDE to execute code when i open files for editing. I want it to execute code only as part of an explicit step that I initiate.

Re: Threat actors expand abuse of Microsoft Visual Studio Code

#237

Earlier quoted context omitted.

Some project types, such as Gradle or Maven projects, use arbitrary commands or plugins in project setup. You have to run arbitrary plugins to know which directories are the source directories, and you have to know which directories are the source directories to do anything in Java.

There’s no need to run that when opening a directory is there?

If you just want to see the files in the directory, then sure. But VS Code is an IDE. It's made for editing software projects which have more structure than that.

Re: Threat actors expand abuse of Microsoft Visual Studio Code

#238
post #79

Earlier quoted context omitted.

Yikes, sounds like hell. Corporate never seems to get that git is the kind of interface you want between your computer and their servers. Then when you trash your computer you can just get it back to the state of being able to git.

They're not using the remote VM as a server but as the development machine though. You don't want to have to git commit and push every time you need to run or even type-check your code. I think what GP describes is actually a pretty okay solution for orgs that don't want to provider their devs with local admin privileges.

You can develop locally if you want to, and lots of people do, but it’s community support. The environment that someone else is obligated to fix for you is the remote one (which they can do by blowing away the container and then you recover your state from Git).

Re: Threat actors expand abuse of Microsoft Visual Studio Code

#239
post #211

Earlier quoted context omitted.

I suspect that you're relying too heavily on the user here. Even for myself, a very experienced developer, I don't have a flash of insight over what my risk exposure might be for what I'm opening at this moment. I don't have a comprehensive picture of all the implications, all I'm thinking is "I need to open this file and twiddle some text in it". Expecting us to surface from our flow, think about the risks and make…

> I don't have a flash of insight over what my risk exposure might be for what I'm opening at this moment Maybe I'm too close to it, but the first sentence gives a very clear outline of the risk to me; Trusting this folder means code within it may be executed automatically. > I don't have a comprehensive picture of all the implications, all I'm thinking is "I need to open this file and twiddle some text in it". I'm c…

> I'm curious what would stop you from opening it in restricted mode? Is it because it says browse and not edit under the button?

loss of syntax highlighting and to a lesser extent the neovim plugin. maybe having some kind of more granular permission system or a whitelist is the answer here.

opening a folder in vscode shouldn't be dangerous.

Re: Threat actors expand abuse of Microsoft Visual Studio Code

#240
post #199

VS Code team member here :wave: As called out elsewhere, workspace trust is literally the protection here which is being circumvented. You're warned when you open a folder whether you trust the origin/authors with pretty strong wording. Sure you may find this annoying, but it's literally a security warning in a giant modal that forces you to chose. Even if automatic tasks were disabled by default, you'd still be vuln…

> It's perfectly fine to not trust the folder, you'll just enter restricted mode that will protect you and certain things will be degraded like language servers may not run, you don't be able to debug (executes code in vscode/launch.json), etc.

This is the main problem with that dialog: It’s completely unclear to me, as a user, what will and will not happen if I trust a workspace.

I treat the selection as meaning that I’m going to have nothing more than a basic text editor if I don’t trust the workspace. That’s fine for some situations, but eventually I want to do something with the code. Then my only options are to trust everything and open the possibility of something (?) bad happening, or not do any work at all. There’s no visibility into what’s happening, no indication of what might happen, just a vague warning that I’m now on my own with no guardrails or visibility. Good luck.

Post reply on HN