Cyber Security News

Cursor AI Code Editor RCE Flaw Allows Malicious Code to Autorun on Machines

A critical vulnerability in the Cursor AI Code Editor exposes developers to stealthy remote code execution (RCE) attacks when opening code repositories, security researchers warn.

The flaw, discovered by Oasis Security, allows attackers to deliver and run harmful code automatically, with no warning prompt, putting vital secrets and cloud access at risk.

Vulnerability Breakdown

Cursor, a popular IDE leveraging AI-assisted coding, ships with Workspace Trust disabled by default. This configuration lets VS Code-style tasks run instantly when a user opens a project folder.

Specifically, if a repository contains a malicious .vscode/tasks.json file with the option runOptions.runOn: “folderOpen”, the IDE executes code as soon as the project is accessed – without seeking user permission or displaying any trust prompt.

This behavior transforms a routine “open folder” action into a silent code execution event.

Attackers can exploit this flaw by crafting repositories that launch tasks capable of stealing credentials, exfiltrating files, or establishing remote access the moment a developer inspects the repository in Cursor.

Oasis Security published a full technical breakdown and working proof of concept to highlight the risk.

Developer machines often hold privileged information: cloud secrets, API keys, and login sessions used for SaaS and CI/CD environments.

When autorun is activated by default, compromise can extend beyond the developer’s laptop to cloud services or automated pipelines.

Attackers exploiting this flaw gain quick access to sensitive environments, including service accounts with broad permissions posing serious risk for engineering teams and infrastructure.

Users of Cursor with default settings are most exposed. In comparison, Visual Studio Code blocks such automatic execution unless Workspace Trust is explicitly given by the user, lowering the risk for VS Code users.

Cursor’s team acknowledges the issue, noting that Workspace Trust can be enabled by users and updated guidance is forthcoming. Oasis Security recommends that teams take these immediate actions:

  • Enable Workspace Trust, and require the startup trust prompt.
  • Disable automatic tasks by setting task.allowAutomaticTasks: “off”.
  • Open unknown repositories in viewer-only editors or disposable containers to limit potential damage.
  • Search your projects for suspicious .vscode/tasks.json entries using “runOn”: “folderOpen”.
  • Monitor for unexpected shell commands and outbound network activity right after opening new projects.

Security experts urge developers to harden their environments to prevent stealthy supply chain attacks driven by booby-trapped code repositories. 

Find this Story Interesting! Follow us on LinkedIn and X to Get More Instant Updates.

Divya

Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Recent Posts

Hackers Use ConnectWise SkyKick Credentials to Access Microsoft 365, Halting Cloud Backups

Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…

1 day ago

Anthropic’s Claude AI Uncovers Origins of NSA-Provided Cryptographic Keys After 25 Years

Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…

1 day ago

Critical WordPress Flaws Allow Attackers to Execute Remote Code Without Authentication

Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…

1 day ago

OpenBSD Kernel Flaw Dating Back 37 Years Enables Local Privilege Escalation to Root

A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…

1 day ago

GhostAction Hackers Hide Credential-Stealing Malware in Fake Font Files Across 94 GitHub Repositories

GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…

1 day ago

SideCopy Hackers Target Indian Organizations With ReverseRAT Malware to Steal Data

Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…

1 day ago