r/programming • u/alexeyr • Jul 15 '26
Cursor 0day: When Full Disclosure Becomes the Only Protection Left
https://mindgard.ai/blog/cursor-0day-when-full-disclosure-becomes-the-only-protection-left
696
Upvotes
475
u/AlexHimself Jul 15 '26
This is concerning. If you open/browser someone else's compromised repo, Cursor will immediately execute the payload without any questions.
If you didn't read the article, they renamed calculator to
git.exeand put it in the repo, opened it with Cursor, then Calculator popped up.Easy fix, straightforward...concerning response (or lack of) by Cursor.
308
u/jdehesa Jul 15 '26
Though this was going to be another relatively convoluted chain of prompts to "jailbreak" the LLM, but this is dumb as fuck. Although the lack of answer and remediation from Cursor is probably the worst part.
100
u/Pseudanonymius Jul 16 '26
This is absolutely horrible. It's a very straightforward bug, and Cursor not fixing this means they simply did not care at all. It can't be hard to fix, a very straightforward hotfix should be absolutely trivial. it also seems like this would also still happen before you even decide to "trust" a codebase, since you can use git in untrusted codebases.
This should be a no-go for any thinking company, regardless of which operating system they use. If this zero-day exists, which is so absolutely trivial to fix, I can guarantee, there are not 10 others, but hundreds. Probably half of them they got in their mailbox, unread. Absolutely incomprehensibly reckless.
41
u/valarauca14 Jul 16 '26
90s are back
58
u/luxmorphine Jul 15 '26
That easy? This is bad bad
17
u/wannaliveonmars Jul 16 '26
Is this because they run
git statusand the current folder is in PATH in Windows? The fix would then be to use the full path name which could beC:\Program Files\Git\cmd\, orC:\Users\<Your-Username>\AppData\Local\Programs\Git\cmd\, orC:\Users\<Your-Username>\AppData\Local\GitHubDesktop\app-<version>\resources\app\git\cmd\.Or they could use
where gitto check the path and choose the git that is not in the current folder.14
u/oak45 Jul 16 '26 edited Jul 16 '26
I had presumed that this was to do with workspace trust
However, I enabled workspace trust, opened a test repo in restricted mode, and git.exe is still executed!
Compared to VS code (1.129):
12
u/ni5arga Jul 16 '26
> The most confusing part of this disclosure is the absence of a response from Cursor. Over the course of seven months, Mindgard repeatedly attempted to engage through every available channel. Initial disclosure was sent directly to Cursor's security reporting e-mail address, as specified in the company's published security.txt file.
Not surprising at all, as a security researcher who hunts for vulnerabilities just for fun on various projects and sites – this is very common and annoying.
6
u/jimm Jul 16 '26
I was kind of surprised that this was Windows-only, so I tried it on a Mac with a binary named
git. It didn't get executed. (I also tried renaming itgit.exe; same non-result.) This might be because I don't have.on my PATH.5
u/forgetfulAlways Jul 16 '26
Insane
20
u/omniuni Jul 16 '26
As bad as it is, I don't know why anyone would think it's particularly unexpected. An AI focused IDE with lots of stuff it can just do arbitrarily. It's a recipe for security disaster.
10
u/TribeWars Jul 16 '26 edited Jul 16 '26
A lot of IDEs have problems like this though. In C/C++ projects, the build scripts often get run the moment a project is opened, since the full compilation context is generally required for IDE features in that language. For instance using "Open Folder" in Visual Studio on a CMake-based project (not sure about Visual Studio Code) will automatically run the CMakeLists.txt script contained in that repository, granting arbitrary code execution to anyone with write access to the repo. Any IDE with a language server that executes any user-controlled code has this vulnerability.
This git one is a bit more stupid, because I really don't see any reason why the IDE should ever look for a git binary inside of a repo. If there is actually some exotic setup where it makes sense, it should be something gated behind a configuration option.
37
u/08148694 Jul 15 '26
They should definitely have fixed it no doubt about it
You’d have to be quite personally negligent though to end up with a malicious git.exe in your project root anyway though. If you get to that point you’re probably going to get hit by some malware with our without cursor being negligent
3
u/SlimyOS Jul 16 '26
Didn't expect any better response. Cursor also allows the agent read any file on the system, with literally no way of disallowing that, that's not documented as prominently but apparently it works "as intended". I often found it reading my personal info or code from other projects when expanded the "Thinking" blocks. Been a long standing issue as well, users reported multiple times on their forum.
They're also pushing tool automation really hard, making it harder to keep using commands as "only run when approved", they have a sandbox (useless because had many bugs + i have no trust in cursor team + even linux kernel which it's based on has a lot of sandbox escape bugs), or an ai agent that reviewes the command to run in non-sandboxed mode (idk based on what the agent reviewes it, like, what if it deletes a directory not tracked by git, it's harmful but idk if it's flagged, and cursor doesn't track file deletions either, im just not comfortable even trying it), has an allowlist feature but it allows only for execution in non-sandboxed mode, i can't set up allowlist + sandbox as 2 layers of protection, it has to be "either layer" which only makes it less secure.
Using cursor daily is a security nightmare, I had to install a separate operating system on a usb stick and boot from there just for work on specific few projects to avoid their ai doing anything weird to my pc. They're clearly not serious about security, they're chasing vibecoding hype. Left cursor this month, now looking into alternatives, surprisingly small number of code-first experiences with ai as an assistant, most pivoted into vibecoding unfortunately.
1
u/ColonelRyzen Jul 16 '26
I just tried this with 3.11.25. I put calc.exe renamed to git.exe inside a freshly cloned repo and opened it in the agent and ide windows and calculator didn't open. This is a fresh install. Am I doing something wrong?
1
u/kilkil Jul 19 '26
looks like I am never using Cursor lol. if they let this slip, who knows how many other 0 days their slop editor has
1
u/rbobby Jul 16 '26
Claude fix this ffs
1
u/StrategyExcellent460 Jul 16 '26
Ditch Cursor. If you had any doubts, you now know for sure which values they align with
1
u/Formal-Knowledge-250 Jul 17 '26
I can't believe there are companies writing blogpost over such a low priority and weak insecurity. Yeah you could also sideload a dll. No shit.
-6
u/dragneelfps Jul 16 '26
Who would've thought the folks who stole code from everyone to train their models won't be stealing your code when you pay to use them?
-65
u/GregBahm Jul 15 '26
The post seems to present this as a big security failure on behalf of Cursor, but this is a strange position to me.
If I hired a human to do work and gave them a computer where I had replaced all the applications with viruses, and then the employee launched any application (and so executed a virus) the fault doesn't seem like it should lie with the employee.
I guess we can decide to hold AI to a standard that humans can't be held to. Is that where we're at? Seems like it would be a happy day for AI if so, which I expect reddit would be conflicted about.
0
u/[deleted] Jul 15 '26
[deleted] — view deleted comment