Beltdown2: Escaping the Cursor CLI sandbox A security researcher found that an attacker-controlled workspace containing a .git/ directory can escape the Cursor CLI's macOS Seatbelt sandbox and run code on a Mac with the logged-in user's full authority and no permission prompt, in any tool permission mode, according to a writeup titled "Beltdown2: Escaping the Cursor CLI sandbox." The exploit arms a repository's .git/config with a core.fsmonitor hook, which Cursor's own internal git runs unsandboxed because the Seatbelt profile wraps only the shell tool; the researcher demonstrated the escape on Cursor CLI build 2026.07.23-e383d2b using a read-only prompt that never ran a shell command. The bug is the same class as the earlier Claude Code escape (Beltdown), but Cursor had no git hardening at all on the path, and the writeup states Cursor fixed it properly. An attacker-controlled workspace/project folder, containing a .git/ directory, can escape the Cursor CLI's macOS sandbox and run code on your Mac with the logged-in user's full authority, no permission prompt, regardless of tool permission mode. The same class of bug as the Claude Code escape Beltdown , but with no git hardening at all. Cursor’s CLI agent ships with a macOS Seatbelt sandbox. Turn it on and shell commands go into a confined profile that can’t reach your files or your network. The sandbox is the guardrail users rely on, especially in --force / --yolo mode where permission prompts are off and the sandbox is all that’s left. Throughout, “workspace” just means the project folder you point the agent at. It’s the only directory the sandbox’s workspace-readwrite policy lets the agent write to - everything outside it, including $HOME , is denied. We armed a workspace’s .git/config with a core.fsmonitor hook, opened it in the Cursor CLI with the sandbox enabled, and sent a read-only prompt. The model never ran a shell command. But a command from that repo ran on our Mac anyway, outside the sandbox, with no prompt in any mode. The root cause is the same one we found in the Claude Code escape Beltdown : the Seatbelt profile wraps only the shell tool, while the harness’s own internal git runs unsandboxed and honors repository-supplied core.fsmonitor hooks. The difference is that Cursor had no hardening at all on the git path, and that Cursor fixed it properly. Demo A ~2 minute narrated walkthrough: the read-only prompt firing the escape, the captured process ancestry proving it is Cursor’s own unsandboxed internal git, the contrast showing the sandboxed shell tool’s $HOME write is blocked while the core.fsmonitor payload’s succeeds, and a control workspace where the hook is removed and nothing escapes. The exploit chain First, the Seatbelt profile gets applied only to the shell tool. Cursor’s CLI agent-cli , build 2026.07.23-e383d2b ships a real sandbox binary, cursorsandbox , which takes a JSON policy and runs a command under a Seatbelt profile: cursorsandbox --policy {"type":"workspace readwrite","networkPolicy":{"default":"deny"}} --