A security vulnerability has been discovered in the AI-powered code editor, Cursor, that allows code execution if a user opens a maliciously crafted repository. This issue arises because the default security setting, Workspace Trust, is turned off, enabling attackers to execute arbitrary code on users’ machines.
According to Oasis Security, “Cursor ships with Workspace Trust disabled by default, so VS Code-style tasks configured with runOptions.runOn: ‘folderOpen’ auto-execute the moment a developer browses a project.” This means a harmful .vscode/tasks.json
file could prompt the IDE to execute commands silently as soon as a folder is accessed, creating a significant threat for users.
Cursor is designed as a fork of Visual Studio Code, which supports Workspace Trust to help developers safely navigate and edit code, irrespective of the source. However, with this setting off, attackers can host a project on platforms like GitHub, embedding covert "autorun" commands that automatically execute when the user accesses their repository in Cursor.
This could lead to serious repercussions, such as credential leaks, file modifications, or broader system compromises. To mitigate these risks, users are encouraged to enable Workspace Trust, utilize alternative code editors for untrusted repositories, and thoroughly audit untrustworthy materials before using Cursor.
The revelation of this vulnerability aligns with a broader trend where prompt injections and jailbreak techniques endanger AI coding tools, such as Claude Code and others, fostering an environment where threat actors can embed harmful instructions into otherwise benign-looking code. Such practices constitute a new wave of attack vectors targeting software development ecosystems.
To protect against these vulnerabilities, developers should exercise vigilance, apply standard security protocols, and stay ahead of evolving threats in the AI-driven programming landscape.
Welcome to DediRock, your trusted partner in high-performance hosting solutions. At DediRock, we specialize in providing dedicated servers, VPS hosting, and cloud services tailored to meet the unique needs of businesses and individuals alike. Our mission is to deliver reliable, scalable, and secure hosting solutions that empower our clients to achieve their digital goals. With a commitment to exceptional customer support, cutting-edge technology, and robust infrastructure, DediRock stands out as a leader in the hosting industry. Join us and experience the difference that dedicated service and unwavering reliability can make for your online presence. Launch our website.