[Bug]: WSL backend binds 0.0.0.0 while "Network access" is off and the UI says "Limited to this machine" #9056
Summary#
With WSL backend enabled and WSL only = ON, the app-managed backend listens on 0.0.0.0:3773 even though Network access is toggled off. The Connections panel states "Limited to this machine", which is not true of the actual bind.
What makes me think this is a bug rather than intended behaviour: on the same machine, a backend started via npx t3@latest service install (systemd user unit) bound 127.0.0.1:3773 correctly. Only the desktop-app-managed WSL backend binds all interfaces. (That systemd unit was stopped at the time of the checks below, so the process bound to 0.0.0.0 is definitively the app-managed backend, running out of ~/.t3/wsl-runtime/….)
Steps to reproduce#
- Windows desktop app → Settings → Connections
- WSL backend → pick a distro → choose Use only WSL
- Leave Network access OFF ("Limited to this machine")
- In the WSL distro:
ss -tlnp | grep 3773
Expected#
127.0.0.1:3773, matching what the UI claims.
Actual#
LISTEN 0 511 0.0.0.0:3773 0.0.0.0:* users:(("node",pid=...))
and it answers on non-loopback addresses:
curl -o /dev/null -w '%{http_code}' http://100.x.x.x:3773/ -> 200 # tailnet IP
curl -o /dev/null -w '%{http_code}' http://172.x.x.x:3773/ -> 200 # WSL eth0
curl -o /dev/null -w '%{http_code}' http://127.0.0.1:3773/ -> 200
Why this matters#
"Limited to this machine" reads as a security property, and a user may reasonably rely on it when deciding whether to open a project containing sensitive material.
On a default WSL2 setup the exposure is narrower than it looks, since WSL's NAT address is not reachable from the LAN without a portproxy. But anyone running Tailscale inside WSL has the backend reachable from every device on their tailnet, with the toggle off and the UI saying otherwise. In my case the only thing preventing that was a restrictive tailnet ACL — containment came from the network, not from the app control that claims to provide it.
Environment#
- Windows 11 + WSL2, Ubuntu 24.04
- Desktop app installed via
winget install T3Tools.T3Code, 2026-09-01 - CLI
t3@0.0.37(used for the contrasting systemd-service test) - WSL backend enabled, WSL only ON
- Network access off; T3 Connect off; Publish agent activity off
Note on scope#
I have not verified whether the UI/API layer on :3773 authenticates. /mcp correctly returns 401 without the bearer token, but I did not test the rest of the surface. If the HTTP layer is fully authenticated then this is a "the UI states something untrue" bug rather than an exposure bug — either way, the toggle and the bind should agree.
Correction to my previous comment — my proposed mechanism was wrong#
Retracting the hypothesis in my comment above. The observations stand; the explanation does not. I read further into
app.asarand the divergence I proposed is not possible in this code path.Why the hypothesis fails#
I suggested the UI mode could fall back to
local-onlywhile the bind host stayed on the persistednetwork-accessible. It cannot: both values are produced by the same object, in the same branch.const resolveDesktopServerExposure = (input) => { if (input.mode === "local-only") return { mode: input.mode, bindHost: DESKTOP_LOOPBACK_HOST, // <- loopback, always, in this branch localHttpUrl, localWsUrl, endpointUrl: null, advertisedHost: null }; const advertisedHost = resolveLanAdvertisedHost(input.networkInterfaces, input.advertisedHostOverride); return { mode: input.mode, bindHost: DESKTOP_LAN_BIND_HOST, endpointUrl: advertisedHost ? `http://${advertisedHost}:${input.port}` : null, advertisedHost }; };mode: "local-only"always impliesbindHost: DESKTOP_LOOPBACK_HOST. Downstream,getState(toContractState) andbackendConfig(toBackendConfig) both read the samestateRef, so the UI mode and the listener's bind host cannot disagree by this route.What the resolver actually does on this machine#
const unavailable = input.requestedMode === "network-accessible" && requestedExposure.endpointUrl === null && !Object.values(input.networkInterfaces).some((addresses) => addresses?.some((a) => !a.internal && a.family === "IPv4" && isTailscaleIpv4Address(a.address)));The downgrade to
local-onlyrequires no usable LAN IPv4 and no Tailscale IPv4. This Mac has both a LAN address (192.168.1.x) and a Tailscale address (100.x.x.x).resolveLanAdvertisedHostskips Tailscale addresses but accepts192.168.1.x, soendpointUrlis non-null,unavailableisfalse, and the resolved state should benetwork-accessiblewithendpointUrl: http://192.168.1.x:3773.So the
0.0.0.0bind is correct for the persisted setting. My earlier framing had it backwards.What I think the actual defect is here#
The listener is right; the Settings panel is wrong. It shows Network access — "Limited to this machine" while the resolved exposure state is
network-accessiblewith a live advertised endpoint.One candidate, offered as a lead rather than a conclusion: the service seeds its state with
const stateRef = yield* make$88(initialRuntimeState());and
initialRuntimeState()is built fromDEFAULT_DESKTOP_SETTINGS.serverExposureMode(local-only) withport: 0. If the panel renders that seed instead of the state written byconfigureFromSettings, it would show exactly "Limited to this machine" regardless of the real bind. I have not confirmed this; the bootstrap lines that would show it had already rotated out ofserver.trace.ndjson.This may not belong on this issue#
Given the above, my case is probably not the same root cause as the original report:
- #9056 as filed: Network access off, backend nevertheless bound to
0.0.0.0— the listener exceeds the setting. - My case: Network access persisted on, backend correctly bound to
0.0.0.0, UI falsely reports "Limited to this machine" — the display contradicts the setting and the socket.
The user-visible hazard is identical, and "Limited to this machine" is untrue in both, which is why I posted here. But the fixes are likely in different places. Happy to move mine to its own issue if a maintainer prefers that — say the word and I will, and I'll link it back here.
Apologies for the noise of a wrong mechanism; I would rather correct it in place than leave it standing.
- #9056 as filed: Network access off, backend nevertheless bound to
tanstack-source added labelsbug
I tried to reproduce this on the current build and could not.
On origin/main b68aedfdb7. A real run needs the Windows desktop app with a WSL2 distro, which no worker has; this VM is Linux. Instead I drove the real resolveWsl config path in apps/desktop/src/backend/DesktopBackendConfiguration.test.ts with DesktopServerExposure.backendConfig set to local-only (bindHost 127.0.0.1, Tailscale Serve off), a win32 environment and a distro IP of 172.27.0.99. The resolved WSL bootstrap.host is '0.0.0.0' (assertion failure: expected '0.0.0.0' to not equal '0.0.0.0'). The other 17 tests in the file pass. resolveWslStartConfig hardcodes
const wslBindHost = "0.0.0.0"and never reads the exposure mode, while the Windows primary binds DESKTOP_LOOPBACK_HOST when local-only. The macOS case in the comments was not reproduced: the commenter later found their saved setting was network-accessible, so the 0.0.0.0 bind was correct there and the defect is only the panel's label.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.
juliusmarminge closed this
Thanks for digging in. I think the test you ran is the reproduction, though, not a failure to reproduce.
The bug as filed is still in the code at
b68aedf. You setDesktopServerExposure.backendConfigto local-only, andresolveWslstill returnedbootstrap.host === "0.0.0.0". That failing assertion is this issue: with Network access off, the WSL backend listens on every interface. It comes from the constant you named:// apps/desktop/src/backend/DesktopBackendConfiguration.ts, resolveWslStartConfig // wslhost loopback forwarding is unreliable on some Windows hosts; advertise the WSL IP instead. const wslBindHost = "0.0.0.0";Both callers (
buildWslPrimaryConfigand theresolveWslservice method) pass onlyportanddistro.buildWslPrimaryConfigreadsserverExposure.backendConfigand then uses only.port, so the exposure mode never reaches the WSL bind.The code already computes the narrower address. Further down, the same function works out the host the Windows renderer will dial:
const rendererHost = usesSharedNetworkStack ? "127.0.0.1" // mirrored networking : Option.getOrElse(distroIp, () => "127.0.0.1"); // NAT: the distro's own IPSo one possible fix: when the exposure mode is local-only, bind
rendererHostinstead of0.0.0.0. As far as I can tell from reading the code, that keeps the renderer's connection working in both networking modes and stops the backend listening on other interfaces:tailscale0, Docker bridges, and under mirrored networking the host's real LAN NIC. Thebootstrapobject is built beforedistroIpis resolved, so the bind would have to move below that. I haven't built or tested this.Under mirrored networking the exposure is wider than my original report said. I wrote that WSL's NAT address keeps the LAN out. Under
networkingMode=mirrored, a0.0.0.0bind inside WSL listens on the Windows host's own interfaces. On an earlier build (2026-09-05), with mirrored networking and Network access off, the desktop-managed WSL backend answered on the host's LAN address. On that address,/mcpandPOST /api/auth/websocket-ticketreturned401, while/and/.well-known/t3/environmentreturned200. So the LAN could reach the unauthenticated surface, not the authenticated API, but "Limited to this machine" was not true.Live repro: I can't give you a fresh live run on the current build, because this machine no longer runs the desktop-managed WSL backend. What I have is the code path above at
b68aedfand the assertion failure from your own test.On the macOS comments: I agree that's a different bug (the bind is correct and the panel label is wrong). Your closing note confirms the label defect, but closing this issue leaves that bug untracked. The macOS commenter offered to file it separately, which seems like the right home for it.
Would you reopen this, or should I open a new issue against
resolveWslStartConfig?
Sign in to join this conversation.
Same mismatch on native macOS — no WSL involved#
This reproduces on a plain macOS desktop install, which I think widens the scope beyond the WSL-managed backend. The contrast you drew (app-managed WSL backend binds
0.0.0.0, systemd-installed backend binds127.0.0.1) suggested WSL was the trigger; on macOS there is no WSL backend at all and the bind is still0.0.0.0with Network access displaying off / "Limited to this machine".Environment#
0.0.46-nightly.20261010.2908t3 service install—t3 service statusreports not installed)Observed#
Settings → Connections shows Network access — Limited to this machine. Meanwhile:
Unlike WSL's NAT address, the macOS LAN address is directly reachable from every device on the local network, so there is no incidental containment here.
Not a CLI override#
The backend was started by the desktop app with no host flag:
~/.t3/userdata/server-runtime.json:Note
hostandoriginalready disagree inside this one file.Where the two values diverge#
~/.t3/userdata/desktop-settings.jsoncontains:I never touched the Network access toggle on this machine. The file was last written 2026-09-28; the persisted mode has been
network-accessiblesince, and the UI has shown "Limited to this machine" throughout.Reading the shipped
app.asar, desktop bootstrap does:That last branch is exactly the state this machine is in: persisted mode is
network-accessible, but the resolvedserverExposureState.modeislocal-only. My reading — offered as a hypothesis, not a verified claim — is that the advertised endpoint falls back to local-only (so the UI renders "Limited to this machine"), while the bind host still comes fromconfigureFromSettingson the persistednetwork-accessiblevalue, leaving the socket on0.0.0.0. If that is right, the UI is reportingserverExposureState.modewhile the listener follows the persisted setting, and the two can disagree on any platform — WSL is incidental.I could not confirm this from logs:
server.trace.ndjsonrotates at 10 MB and on this machine covers only the last ~3 hours, so the 06:17Z bootstrap lines are long gone. Someone who can reproduce with a fresh log should look forbootstrap fell back to local-only because no advertised network host was available.A plausible trigger for "no advertised network host" at boot is Tailscale not yet being up when the app launches, which may make this adjacent to #17362.
Same scope caveat as the original report#
Like you, I have not audited whether the full surface on
:3773authenticates. Either way the toggle, the persisted setting, and the actual bind should agree, and "Limited to this machine" should not be shown while the port answers on the LAN.Possibly related#
t3 connect statusprintsPublish agent activity: enabledwhile the Settings UI shows that toggle off — another CLI/UI disagreement in the same panel, which may share the "CLI reads persisted value, UI reads runtime state" shape. Happy to split that out if it is unrelated.