Skip to content
RCE Write-up Beginner

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.

Aacle Follow

Published on medium.com

Cursor and HackerOne closed it as “informative, out of scope.” Seven months later, still no patch. So is it even a bug?

Abhishek meena, on medium.com

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

  1. Create a folder and optionally initialise a git repository.
  2. Copy Windows Calculator into the folder and rename it to git.exe.
  3. Open the folder in Cursor.
  4. 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.

More by Aacle

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.