Sandbox blocks unix socket creation at /tmp/ssh-* despite allowUnixSockets pattern

Resolved 💬 5 comments Opened Mar 29, 2026 by jippi Closed May 2, 2026

Description

Git push over SSH fails in sandbox mode with Operation not permitted when SSH tries to create a ControlMaster unix socket, despite the path matching the configured allowUnixSockets pattern.

Error

unix_listener: cannot bind to path /tmp/ssh-git@gitlab.com:22.YC5szvm3NdQ8LJZR: Operation not permitted
fatal: Could not read from remote repository.

Sandbox configuration

The sandbox config includes both:

  • Filesystem write allowlist: /tmp, /private/tmp
  • Unix socket allowlist: /tmp/ssh-*, /private/tmp/ssh-*

The failing path /tmp/ssh-git@gitlab.com:22.YC5szvm3NdQ8LJZR should match the glob /tmp/ssh-*.

Suspected cause

The @ and/or : characters in the SSH control socket filename may be interfering with the sandbox's internal glob pattern matching. Alternatively, macOS resolves /tmp/private/tmp at the syscall level, and the canonicalized path may not be matched correctly against both patterns.

Workaround

Running with dangerouslyDisableSandbox: true allows the push to succeed.

Environment

  • macOS (Darwin 25.3.0)
  • Git push over SSH to GitLab
  • SSH ControlMaster enabled (creates reusable connection sockets in /tmp)

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗