Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Summary
On Ubuntu 24.04 LTS with kernel.apparmor_restrict_unprivileged_userns=1 (the default), the cursor-sandbox-remote AppArmor profile shipped for Cursor’s remote SSH server fails to grant the necessary permissions for the cursorsandbox helper. This causes the sandbox preflight to fail and Cursor falls back to unsandboxed shell execution.
Environment
- Cursor: 2.5.26 (stable)
- Cursor Server commit:
7d96c2a03bb088ad367615e9da1a3fe20fbbc6a0 - Ubuntu 24.04.4 LTS (Noble), kernel 6.8.0-101-generic
- AppArmor parser 4.0.1
kernel.apparmor_restrict_unprivileged_userns = 1(default on Ubuntu 24.04)- Cursor remote server via SSH
Errors
From ~/.cursor-server/data/logs/*/exthost*/remoteexthost.log:
User namespace creation denied:
Error: Failed to apply sandbox: IO error: Step 1-2/7 (user namespace) failed:
IO error: Failed to write /proc/self/uid_map (mapping UID 0 -> 155076):
Operation not permitted (os error 1) (errno 1)
Loopback network setup denied:
Error: Failed to apply sandbox: IO error: Step 2.5/7 (loopback setup) failed:
IO error: loopback: failed to bind NETLINK_ROUTE socket
Sandbox support is detected as false, so Cursor runs without sandboxing.
Root Cause
The installed profile at /etc/apparmor.d/cursor-sandbox-remote has three issues:
- Missing
abi <abi/4.0>,— On AppArmor 4.0 (Ubuntu 24.04+), theusernsrule requires the ABI 4.0 declaration to be properly recognized. Compare with Ubuntu’s own VS Code profile at/etc/apparmor.d/codewhich correctly includes it. - Missing
include <tunables/global>— Standard practice for AppArmor profiles; needed for proper variable resolution. - Missing
networkandcapability net_adminrules — The sandbox performs loopback network setup (NETLINK_ROUTE socket), which requires these permissions.
Current (broken) profile
profile cursor_sandbox_remote /home/*/.cursor-server/bin/*/*/resources/helpers/{cursor-sandbox,cursorsandbox} {
file,
/** ix,
capability sys_admin,
capability chown,
capability setuid,
capability setgid,
capability setpcap,
userns,
mount,
remount,
umount,
/home/*/.cursor-server/bin/*/*/resources/helpers/{cursor-sandbox,cursorsandbox} mr,
}
Proposed Fix
abi <abi/4.0>,
include <tunables/global>
profile cursor_sandbox_remote /home/*/.cursor-server/bin/*/*/resources/helpers/{cursor-sandbox,cursorsandbox} {
file,
/** ix,
capability sys_admin,
capability chown,
capability setuid,
capability setgid,
capability setpcap,
capability net_admin,
userns,
network,
mount,
remount,
umount,
/home/*/.cursor-server/bin/*/*/resources/helpers/{cursor-sandbox,cursorsandbox} mr,
}
After applying: sudo apparmor_parser -r /etc/apparmor.d/cursor-sandbox-remote
Suggestion
Cursor should ship the corrected profile and ideally auto-install/reload it during remote server setup (with appropriate privilege escalation), or at minimum surface a clear diagnostic message when the sandbox preflight fails due to AppArmor, pointing users to the fix.
Steps to Reproduce
- Set up an Ubuntu 24.04 server with default AppArmor configuration (
kernel.apparmor_restrict_unprivileged_userns = 1). - Connect to the server via Cursor’s Remote-SSH.
- Cursor installs
~/.cursor-serverand deploys thecursor-sandbox-remoteAppArmor profile to/etc/apparmor.d/. - Open a terminal or trigger any agent/shell execution in Cursor.
- The sandbox preflight fails silently — Cursor falls back to unsandboxed execution.
- Errors are logged in
~/.cursor-server/data/logs/*/exthost*/remoteexthost.log.
Expected Behavior
The cursorsandbox helper should pass its preflight check and Cursor should run shell commands inside a sandboxed environment. The shipped AppArmor profile should work out of the box on Ubuntu 24.04+ with default kernel settings.
Actual Behavior
The sandbox preflight fails with permission errors. Cursor detects sandbox support as false and runs all shell commands unsandboxed, reducing security.
Operating System
MacOS
Version Information
Version: 2.5.26
VSCode Version: 1.105.1
Commit: 7d96c2a03bb088ad367615e9da1a3fe20fbbc6a0
Date: 2026-02-26T04:57:56.825Z
Build Type: Stable
Release Track: Default
Electron: 39.4.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0
Does this stop you from using Cursor
No - Cursor works, but with this issue