The Cursor Zero-Day That Sat Through 70 Versions
Cursor on Windows executes a git.exe file placed in the root of an opened repository, allowing arbitrary code execution as the logged-in user without any user interaction. An attacker could place a malicious git.exe in a repository to run code when a victim opens it in Cursor.
Cursor and HackerOne closed it as “informative, out of scope.” Seven months later, still no patch. So is it even a bug?
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, Cursor uses CreateProcess with a bare executable name and sets the working directory to the repository root, so Windows resolves git.exe from the repository before the system PATH.
Impact
An attacker could execute arbitrary code as the logged-in user, potentially stealing credentials, installing a backdoor, or compromising the developer's employer, though the text notes this is Windows-only and the demo used a harmless calculator.
What the attacker needed
Cursor installed on Windows; Victim opens a malicious repository
The fix
Cursor should resolve git from a trusted absolute path or verify the executable's location before running it, and should not execute binaries from the repository root.
How it was found
- Create a folder and optionally initialise a git repository.
- Copy Windows Calculator into the folder and rename it to git.exe.
- Open the folder in Cursor.
- Calculator opens, demonstrating code execution.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you open a folder in Cursor on Windows, the program looks for a file called git.exe to do version control tasks. It checks the folder you opened before checking the normal system location, so if someone puts a fake git.exe in that folder, Cursor runs it. This means opening a malicious repository can run any program on your computer without asking you.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.