Cursor published two critical advisories on 5 June 2026 for flaws, fixed in Cursor 3.0, that let an agent steered by malicious instructions write files outside the workspace and break out of the terminal sandbox. One abused the agent-controlled working_directory parameter, the other a symlink and failed path check. Either allowed unsandboxed code execution with the user's privileges, which exposes every key, token and credential file the user can read. Update to Cursor 3.0 or later.
| Disclosed | June 5, 2026 |
|---|---|
| Affected | Cursor |
| Type | AI agent |
| Status | Resolved |
| CVE | CVE-2026-50548, CVE-2026-50549 |
What was exposed
Anything the user account can access. Cursor runs agent terminal commands in a sandbox that may write only to the command's working directory. In CVE-2026-50548 the agent could set working_directory to a sensitive location, so the sandbox granted write access outside the workspace. In CVE-2026-50549, when path canonicalization failed (because the target did not exist or read permission was removed), Cursor fell back to the original path and wrote through an in-workspace symlink without approval. Cursor says both enable non-sandboxed remote code execution, for example by overwriting the cursorsandbox helper so later commands run unsandboxed, with no user interaction beyond a benign prompt. Once outside the sandbox, code can read model provider API keys, ~/.ssh, cloud CLI credentials, Git credential stores and .env files. The advisories credit Cato AI Labs, whose write-up calls the pair DuneSlide, and frame the attacker as a malicious agent, that is, an agent following instructions an attacker managed to feed it. The advisories do not report exploitation in the wild.
Am I affected?
You are affected if you used Cursor's agent on a version below 3.0, particularly with MCP servers, web content or repositories you do not control, since those are paths by which instructions can reach the agent. Check your version under Cursor's About dialog. There are no published indicators of past exploitation; a modified cursorsandbox helper or files written outside your projects by the agent would be a sign worth investigating.
What to do now
- Update Cursor to 3.0 or later.
- If you used the agent on untrusted repositories or MCP servers on an older version, rotate the provider API keys, GitHub tokens and cloud credentials stored on that machine.
- Remove MCP servers you do not need, and review what each remaining one can return to the agent.
- Keep long-lived credentials out of plain files the agent's user account can read.
Keys to rotate
Guides to the credentials this incident put at risk:
Timeline
- Cursor publishes GHSA-3p48-7v9f-v5cw and GHSA-3v8f-48vw-3mjx (critical), crediting Cato AI Labs; both are fixed in Cursor 3.0. Source
- NVD publishes CVE-2026-50548 and CVE-2026-50549. Source
Indicators
From the advisories listed below. Use them to search your logs, lockfiles and workflow runs.
- Cursor versions below 3.0.
- Unexpected changes to the
cursorsandboxhelper or files written outside the workspace during agent sessions.
What this changes for credential handling
- The sandbox was the only thing between injected instructions and the user's credential files. BotPassword is built so those credentials are not sitting in files the agent can reach once a sandbox fails.
Frequently asked questions
Am I affected by the Cursor incident?
You are affected if you used Cursor's agent on a version below 3.0, particularly with MCP servers, web content or repositories you do not control, since those are paths by which instructions can reach the agent. Check your version under Cursor's About dialog. There are no published indicators of past exploitation; a modified cursorsandbox helper or files written outside your projects by the agent would be a sign worth investigating.
What was exposed in the Cursor incident?
Anything the user account can access. Cursor runs agent terminal commands in a sandbox that may write only to the command's working directory. In CVE-2026-50548 the agent could set working_directory to a sensitive location, so the sandbox granted write access outside the workspace. In CVE-2026-50549, when path canonicalization failed (because the target did not exist or read permission was removed), Cursor fell back to the original path and wrote through an in-workspace symlink without approval. Cursor says both enable non-sandboxed remote code execution, for example by overwriting the cursorsandbox helper so later commands run unsandboxed, with no user interaction beyond a benign prompt. Once outside the sandbox, code can read model provider API keys, ~/.ssh, cloud CLI credentials, Git credential stores and .env files. The advisories credit Cato AI Labs, whose write-up calls the pair DuneSlide, and frame the attacker as a malicious agent, that is, an agent following instructions an attacker managed to feed it. The advisories do not report exploitation in the wild.
Other ai agent and mcp incidents
- OpenCode on Windows and WSL ran commands from a malicious MCP server during OAuth sign-in 2026-10-04
- OpenCode server's upgrade endpoint let any webpage install an attacker's npm package 2026-09-24
- Claude Code trust dialog could be bypassed with a spoofed git worktree, running repo hooks 2026-04-24
- Claw Chain: four OpenClaw flaws let a foothold read agent secrets and escape the sandbox 2026-04-23
- OpenClaw Control UI sent its gateway token to any gatewayUrl in a link, enabling 1-click RCE 2026-01-31
- Claude Code could send Anthropic API keys to a malicious repo's endpoint before the trust prompt 2026-01-20