STUPID-2026-0096

Cursor's terminal sandbox trusted an agent-set working directory, letting zero-click prompt injection escape it and gain code execution (CVE-2026-50548)

9.0critical
June 5, 2026Source checkedRepro reported

Why 9/10

Zero-click sandbox escape: any content the agent read could run code on the machine (CVSS 9.8). Fixed in Cursor 3.0; no exploitation reported.

Scope
4/4
Many organisations or the public: a flaw in a widely used product, mass exposure, a large outage
Recoverability
3/3
Permanently lost or irreversible, including data that was exposed
Did it happen
1/2
Demonstrated (proof of concept, reproduction, controlled test or near-miss) with no real victim reported
Beyond the user
1/1
Production systems, customers or third parties, or credentials and sensitive personal data

The score is the sum of these four factors. How each factor is scored · scored 2026-10-29

Status and what to do

Affected
Cursor before 3.0, agent terminal commands in the default sandbox.
Fix status
Fixed · Fixed in Cursor 3.0, per the vendor advisory.
Mitigation
Update to Cursor 3.0 or later.
Last reviewed
2026-10-29 · Report a correction to this record
  1. Instruction given

    N/A — this is a flaw in Cursor's own terminal-sandbox design, triggerable by content the agent merely reads (e.g. an MCP tool response or a web page), not a task a user knowingly asked the agent to perform.

  2. Expected behavior

    Cursor's agent terminal sandbox should confine command execution and file writes to the project workspace regardless of what parameters the agent itself sets, so that content the agent reads cannot expand its own write access.

  3. Actual behavior

    Before version 3.0, Cursor's sandbox granted write access to the working directory of an agent-run terminal command, and the agent could set that working_directory parameter itself. A prompt injected into content the agent merely read (an MCP connector response, a web search result) could instruct it to point working_directory at a sensitive path outside the workspace and overwrite the cursorsandbox helper binary that enforces the sandbox, disabling sandboxing for every command that followed — remote code execution with no click or approval from the user.

  4. Damage

    Rated CVSS 9.8 (3.1) / 9.3 (4.0), critical. Any content an agent read — not just code it was told to run — could achieve unsandboxed code execution on the developer's machine under the developer's own privileges, exposing local secrets, source, and credentials. Disclosed by Cato AI Labs as one of two paired flaws named DuneSlide (with CVE-2026-50549); fixed in Cursor 3.0.

Full write-up

Cato AI Labs disclosed that Cursor's default sandbox for agent-run terminal commands — meant to confine writes to the project workspace — could be escaped without any user interaction. The sandbox allowed writes to a command's working directory, and working_directory was a parameter the agent itself controlled. Because Cursor's agent can act on instructions hidden in content it merely reads (an MCP tool's response, a web page fetched during a task), an attacker who could get such content in front of the agent could direct it to set working_directory to a sensitive location and overwrite cursorsandbox, the helper binary that enforces sandboxing. Once that binary was overwritten, every subsequent command ran unsandboxed. No malicious code needed to be run by the user, and no approval prompt intervened — reading poisoned content was enough. Assigned CVE-2026-50548 and rated critical (CVSS 9.8 under 3.1), it was one of two vulnerabilities in the disclosure Cato named DuneSlide; the other, CVE-2026-50549, separately exploited a symlink-resolution fallback for the same effect. Both were fixed in Cursor 3.0.

Classification

Agent
Cursor
Root cause
Other
Domain
Security
OWASP Agentic Top 10 (our mapping)
ASI01 Agent Goal Hijack · ASI05 Unexpected Code Execution (RCE) list
MIT AI Risk Repository (our mapping)
2.2 AI system security vulnerabilities and attacks taxonomy

Related incidents

Cite this record
StupidLLM. "STUPID-2026-0096: Cursor's terminal sandbox trusted an agent-set working directory, letting zero-click prompt injection escape it and gain code execution (CVE-2026-50548)." AI Agent Incident Database, 2026. https://www.stupidllm.com/incident/STUPID-2026-0096/ (accessed 2026-12-04). CC BY 4.0.

← STUPID-2026-0095By IDSTUPID-2026-0097 →

Get told when an agent breaks something

We document AI agent failures daily, severity-scored against a published scale. Each Monday, if any scored 7 or above that week — deleted data, leaked secrets, broken production — you get one email with the sources. When nothing did, you get nothing.

This database is callable over MCP — query it from inside your agent.