Back to all lessons
Awareness Lessons
5 months ago

Cursor AI Editor Executes Malicious git.exe from Cloned Repos Without Warning

Written by AI from the linked story. Not reviewed by an editor. How this works

The root cause of this vulnerability is a dangerous configuration flaw in Cursor's Windows build: the application resolves executable names using the current working directory before checking system PATH locations, a classic 'binary planting' or 'DLL/EXE hijacking' pattern. An attacker simply needs to name a malicious binary 'git.exe' and place it in a repository root — when a victim clones and opens the project, Cursor silently executes it. This is particularly severe because developers routinely clone untrusted or unfamiliar repositories as part of their workflow, making the attack surface wide. The unpatched status compounds the risk, as there is currently no vendor fix available, leaving all Windows Cursor users exposed to full credential and source code compromise.

Tactical Insight

Immediate actions

  • Avoid cloning and opening untrusted or unverified repositories in Cursor on Windows until a patch is released.
  • Inspect any cloned repository root directory for unexpected executables (e.g., git.exe, curl.exe) before opening the project in any IDE.
  • Consider switching to an alternative code editor for untrusted repository review until Cursor issues a fix.

Configuration hardening

  • Configure Windows environments so that the system PATH is resolved before the current working directory, reducing binary planting risk across all applications.
  • Apply AppLocker or Windows Defender Application Control (WDAC) policies to block execution of unsigned or unexpected binaries from user-writable directories.
  • Restrict developer workstations so that SSH keys and cloud tokens are stored in protected credential managers rather than flat files accessible to arbitrary processes.

Detection measures

  • Enable endpoint detection and response (EDR) rules to alert on executions of common system tool names (git.exe, ssh.exe) originating from non-standard paths such as repository directories.
  • Monitor for unexpected child processes spawned by Cursor and alert on any process accessing SSH key files or cloud credential stores.
  • Implement code review pipeline scanning to flag repositories containing executable files in their root directories before developers clone them locally.

Back this up with a control

All controls and vendors

Training helps people spot this. These controls make the attack fail even on the day someone does not.