NomShub: Weaponizing Cursor's Remote Tunnel Through Indirect Prompt Injection and Sandbox Breakout
This article discloses NomShub, a critical vulnerability chain in the Cursor AI code editor that allows a malicious repository to silently hijack a developer's machine with no user interaction beyond opening the repository. The attack combines three elements: indirect prompt injection (malicious instructions hidden in a README file), a sandbox escape via shell builtins (Cursor's command parser is blind to commands like export and cd, allowing escape from workspace restrictions), and Cursor's built-in remote tunnel feature (cursor-tunnel) which provides authenticated shell access through Microsoft's Dev Tunnels infrastructure. The AI agent autonomously executes a multi-step chain: escaping the sandbox using a one-line command, establishing persistence by writing to ~/.zshenv, terminating existing tunnel processes, clearing cached GitHub credentials, starting a new tunnel, capturing the GitHub device authorization code, and exfiltrating it to an attacker-controlled server. Once complete, the attacker gains persistent, undetectable shell access with full user privileges. The attack is a Living-Off-The-Land (LOTL) attack because cursor-tunnel is a legitimately signed and notarized binary, evading antivirus and EDR. The article notes that Chinese APT group Stately Taurus has already abused similar VS Code tunnels in espionage operations. Recommendations include fixing command parsers to recognize shell builtins, restricting macOS sandbox writable scope to the workspace, implementing explicit confirmation for tunnel operations, and treating repositories as untrusted input. A fix is confirmed for Cursor 3.0.
https://www.straiker.ai/blog/nomshub-cursor-remote-tunneling-sandbox-breakout
Comments
Post a Comment