Skip to content
Submit incident
AII-1001-88481
ConfirmedA court, a regulator or the organization itself has stated the core facts, or the record cites a court or regulator source.

Cursor Agent arbitrary file write via prompt injection in @Docs

A regression in Cursor versions 0.45.0-0.48.6 allowed the Cursor Agent to write files outside of the opened workspace through prompt injection in maliciously crafted @Docs content. The vulnerability required deliberate prompting and was patched in version 0.48.7.

7 April 2025 Β· Cursor Β· Security and cyberattacks
7 April 2025
AII-1001-884812 sources ↓
Quick facts
Organization
Cursor (subject)
Category
Security and cyberattacks
Source
github.com
Date
7 April 2025
Drafted by
Raidu Incident Detection

What happened

A regression in Cursor versions 0.45.0 through 0.48.6 allowed the Cursor Agent to write files outside of the opened workspace when prompted directly by users or via maliciously crafted context in @Docs features.

The vulnerability required deliberate prompting to exploit and displayed edited files in the UI for user review before writing.

Reported impact

An attacker could cause the agent to automatically write to files outside the intended workspace.

Index analysis

The vulnerability stemmed from improper input validation (CWE-20) in the Cursor Agent's file path restrictions.

Cursor patched the issue in version 0.48.7 by requiring explicit user confirmation before writing to out-of-workspace files.

Governance controls

Cursor recommends users only include trusted pieces of context in prompts and always review edits made by the agent.

Classification

Organization
Cursor (subject)
Category
Security and cyberattacks
Harm status
Potential harm
Intent
Unintentional
Timing
Post-deployment
Harmed
Consumers
Failure modes
Prompt injection, Unsafe autonomous behaviour, Agent misaction
AI systems
Cursor Agent

Sources and evidence

This record was researched and written by the Index, based on the following original reporting.

github.com
https://github.com/getcursor/cursor/security/advisories/GHSA-qjh8-mh96-fc86
cve.org
NVD entry
Jul 2026HalluSquatting attack exploits AI coding assistants to install botnet malwareWell documentedSecurity and cyberattacksArs TechnicaCrypto BriefingCyber Security News+2Jul 2026GhostApproval Symlink Flaw Enables Remote Code Execution via AI Coding AssistantsConfirmedSecurity and cyberattacksIT Security News - cybersecurity, infosecurity newsInfoWorldApr 2026Cursor AI agent running Claude Opus 4.6 deleted PocketOS production databaseConfirmedSecurity and cyberattackscybersecuritynews.comtomshardware.comSep 2025Security risks in MCP-enabled AI systems due to identity fragmentationReportedSecurity and cyberattacksTechRadarBusinessday NGSep 2025Remote code execution flaw in Cursor AI code editor enables automatic malware executionWell documentedSecurity and cyberattacksCyber Security NewsIT Security News - cybersecurity, infosecurity newsZDNet+1