microsoft / microsoft/vscode-remote-release
Remote SSH: askpass socket path exceeds macOS 104-char Unix socket limit (regression in 0.123.0)
Nobody has claimed this yet.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 469
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
Environment
- VS Code: 1.123.0
- Remote - SSH extension: 0.123.0
- OS: macOS (Darwin 25.5.0)
- Remote target: Linux (local network, SSH key with no passphrase)
Bug
The getIPCHandlePath("askpass", 20) function in the Remote SSH extension generates a Unix domain socket path that exceeds macOS's 104-character limit for sun_path in sockaddr_un.
The generated path follows this pattern:
${os.tmpdir()}/vscode-ssh-askpass-${randomBytes(20).toString('hex')}.sock
On macOS, os.tmpdir() returns a long path like:
/var/folders/h8/rh8crjd90y958tn9gmmd2h8m0000gp/T/
This results in a socket path of ~131 characters:
/var/folders/h8/rh8crjd90y958tn9gmmd2h8m0000gp/T/vscode-ssh-askpass-96e1eb7fc64181afe031df77e5f06e04161d4beb.sock
The socket silently fails to bind, causing the local server's /delay-shutdown keepalive requests to fail with EINVAL. After 3 failed attempts (at 2-second intervals), the connection is dropped:
Server delay-shutdown request failed: connect EINVAL /var/folders/h8/rh8crjd90y958tn9gmmd2h8m0000gp/T/vscode-ssh-askpass-8776ed6fc311016dd310b4d4a73aa8d0d9d352c2.sock - Local (undefined:undefined)
This causes constant reconnection loops.
Regression
This was not an issue before the 0.123.0 update (applied 2025-06-03). The remote.SSH.ipcSocketPath setting exists for the main IPC socket but does not apply to the askpass socket.
Suggested Fix
Either:
- Respect
remote.SSH.ipcSocketPathfor the askpass socket as well, or - Reduce the random bytes from 20 (40 hex chars) to something shorter (e.g., 8 bytes / 16 hex chars), or
- On macOS, detect the path length and fall back to
/tmpif it would exceed 104 characters
Workaround
Launch VS Code with TMPDIR=/tmp:
#!/bin/bash
export TMPDIR=/tmp
exec open -a "Visual Studio Code" "$@"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at getIPCHandlePath("askpass", 20) and trace how its generated path is used to bind and connect the Unix socket. Reproduce with a long macOS TMPDIR or the reported path, then verify that the askpass socket stays within the 104-character limit and that delay-shutdown requests no longer fail or trigger reconnection loops.
Written by the indexing model from the issue text.
Assessment
- Domain
- devtools, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100