Cursor Vulnerability: A Cloned Repository Can Run Code on Windows

Translated by a model; the original is in Russian.

· Security
A vulnerability has been found in the Cursor code editor on Windows: if a file named git.exe sits in the project root, the editor runs it with no warning and no confirmation. The malicious file then gains access to the user's SSH keys, cloud tokens and source code.

cover.svg

Researchers have described a vulnerability in the Cursor code editor that affects Windows users. The problem lies in how the application handles the opening of repositories.

If the project's root folder contains a file named git.exe, Cursor launches it automatically. There is no confirmation prompt and no warning that the folder's contents are about to be executed.

What Happens on Launch

The malicious binary runs under the account of the user who opened the repository in the editor. This means it gains the same access rights as the user themselves — including access to SSH keys and cloud service tokens, as well as to the project's source code.

What makes the vulnerability distinctive is that Cursor keeps re-running the file for the entire time the project stays open in the editor. As a result, opening the repository once may not be enough to eliminate the threat — the malicious code will be triggered again with every access.

Attack Vectors

This kind of scheme is dangerous above all for developers who clone third-party repositories — for example, when contributing to open source projects, reviewing someone else's code, or working with public packages. An attacker could prepare a repository with a malicious git.exe in the root and distribute it disguised as a legitimate project.

Because execution happens without any visual indicator or request for permission, the user may not suspect that opening the project in Cursor has launched a foreign executable.

The report does not state whether a fix for the vulnerability had been released as of the time of publication. Windows users who work with Cursor should be cautious about opening repositories from untrusted sources and should check the contents of the project's root folder before opening it in the editor.


Source: The Hacker News

Comments

Sign in, to comment.

  • No comments yet.