You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Authenticate WSL backend readiness before exchanging the bootstrap token #16918
Track a pre-existing, low-severity weakness in WSL backend readiness and local authentication. This follow-up is outside the scope of PR #13745, which changes WSL NAT URL selection.
scanForWslPort checks port availability on 127.0.0.1 and releases the port immediately. Another local process can acquire the port before the WSL backend binds it. The readiness helper accepts a generic 2xx response. The selected responder URL can then become currentConfig.httpBaseUrl, and the local-auth flow sends desktopBootstrapToken to that URL in a POST to /oauth/token.
WSL already uses 127.0.0.1 when distro IP lookup fails on main. PR #13745 does not change scanForWslPort. The weakness is therefore not introduced by that PR.
Required changes
Establish backend ownership before accepting a readiness responder URL and exchanging the bootstrap token. Evaluate a backend-specific authenticated challenge or an atomic port-ownership mechanism. Do not send the bootstrap token to an unverified responder as part of the ownership check.
Preserve loopback-first WSL URL selection and the distro-IP fallback.
Affected areas
WSL port selection: scanForWslPort.
apps/desktop/src/backend/DesktopBackendManager.ts: readiness probing and currentConfig.httpBaseUrl updates.
The same weakness applies on macOS when more than one local user account exists. Any uid can bind a loopback port above 1024. While the desktop backend is not listening (quit, restart, update), another user's process can hold 127.0.0.1:3773 and receive the bootstrap token. An ownership check that compares the listener's uid with the desktop's uid (for example, lsof -nP -a -iTCP:<port> -sTCP:LISTEN -Fu) would close this case.
I tried to reproduce this on the current build and could not.
Not reproduced: this is a vulnerability report (a local process can receive the desktop bootstrap credential), and the brief says not to reproduce those in public artifacts. Checked only with REST issue/PR searches against current origin/main (3288254). Related: open issue #16826 (the accidental version: desktop sends its bootstrap token to a WSL background service on the same port) and open, unmerged PR #21102, which adds a per-launch desktopLaunchId check before the bootstrap exchange.
Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.
Activity
willsheldon commentedon Oct 9, 2026
The same weakness applies on macOS when more than one local user account exists. Any uid can bind a loopback port above 1024. While the desktop backend is not listening (quit, restart, update), another user's process can hold
127.0.0.1:3773and receive the bootstrap token. An ownership check that compares the listener's uid with the desktop's uid (for example,lsof -nP -a -iTCP:<port> -sTCP:LISTEN -Fu) would close this case.juliusmarminge commentedon Nov 20, 2026
I tried to reproduce this on the current build and could not.
Not reproduced: this is a vulnerability report (a local process can receive the desktop bootstrap credential), and the brief says not to reproduce those in public artifacts. Checked only with REST issue/PR searches against current origin/main (3288254). Related: open issue #16826 (the accidental version: desktop sends its bootstrap token to a WSL background service on the same port) and open, unmerged PR #21102, which adds a per-launch desktopLaunchId check before the bootstrap exchange.
Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.