Description

A high-severity vulnerability (CVE-2026-26268) in Cursor, an AI-powered coding environment, allows attackers to execute arbitrary code on a developer’s machine simply by tricking them into cloning a malicious repository. The exploit requires no additional user interaction beyond standard development workflows, making it particularly dangerous. As Cursor automates tasks through its AI agent, the vulnerability demonstrates how trusted development tools can unintentionally expand the attack surface. The issue arises from the interaction between Cursor’s AI agent and legitimate Git features such as hooks and embedded bare repositories. Attackers craft repositories containing a nested bare repository with a malicious pre-commit hook. When the Cursor agent performs routine actions like git checkout, the embedded hook is triggered automatically, executing attacker-controlled code without user awareness or confirmation. This behavior occurs silently and outside the agent’s decision-making context, meaning developers may not detect any abnormal activity. Since developer systems often contain sensitive assets such as source code, API keys, and credentials, successful exploitation can lead to broader organizational compromise. The vulnerability highlights a critical gap in traditional security practices, where developer environments and AI-assisted workflows are not always treated as high-risk attack surfaces.