Hacker News new | ask | show | jobs
by paxys 17 days ago
Clone a repo and run "npm install" and the exact same thing will happen. You can say "oh I would never run npm install on a repo I don't trust"...but then why are you cloning it and opening it in an IDE in the first place? Especially an IDE whose entire purpose is to run autonomous coding agents?
2 comments

The difference is that I expect "npm install" to execute code, where I do not expect merely opening a repo to look at the files in Cursor to execute anything.
IDEs do syntax highlighting, typechecking, linting, automatic git refreshes. All of this happens in the background without you executing any code. If you open a Typescript project in VS Code and it automatically shows you a list of errors where do you think it got them from? It ran the tsc executable in your node_modules folder.
> syntax highlighting, typechecking, linting, automatic git refreshes

In most languages, none of those things involve execution of code in the repo. In languages that do - for example Elixir - it prompts you to trust them first.

Visual Studio Code asks you if you trust the files in the folder you open, or at least it always has done for me. Presumably this stuff stops working if you don't?
I'm a Python dev so don't do much typescript, this sounds crazy too!
Cursor is an editor. Why is it executing untrusted code when a folder is opened? Opening a folder is not equivalent to executing a script contained in the repo. How can you think that is ok?
It's not executing untrusted code, it's calling git when you have a malicious version of git on your system
No, read the report. It will call an executable called git.exe in the untrusted repo.