fix(server): stop advertising Windows hotspot and VPN tunnel addresses as LAN routes #25991
Problem#
A server bound to every interface advertises two kinds of host-only addresses as "LAN" direct endpoints, and paired clients save them as routes marked "found automatically" and probe them on every connect: the Windows Mobile hotspot / Wi-Fi Direct virtual adapter (Local Area Connection* 2, 192.168.137.1), and VPN or proxy tunnel interfaces in 198.18.0.0/15, such as a macOS utun at 198.19.2.2. Reproduced on main 36d4d711b7 with a server in a Linux network namespace that has a LAN interface and a utun40 at 198.19.2.2. The paired web client listed http://198.19.2.2:3773/ · found automatically next to the real route.
Change#
VIRTUAL_INTERFACE(apps/server/src/startupAccess.ts) also matches interface names ending in* <n>. That is how Windows names its hidden hotspot / Wi-Fi Direct adapters in every locale (Local Area Connection* 2,LAN-Verbindung* 10); real connections areEthernet,Ethernet 2orWi-Fi. This matches how macOS Internet Sharing'sbridge100is already treated. The startup pairing-host pick uses the same filter, so it no longer picks that adapter either.isAdvertisableAddress(apps/server/src/environment/DirectEndpoints.ts) rejects 198.18.0.0/15, the RFC 2544 benchmarking range that VPN and proxy clients use for tunnel addresses. The check goes by address rather than by theutunname, so Tailscale'sutunkeeps its tailnet route.isPrivateNetworkHostis unchanged, so the private-network access check behaves as before.- The same range check (
isVpnTunnelAddress) also applies when a private-network listener picks the address for its printed pairing URL, so a tunnel listed before the LAN interface no longer becomes the connection string.
Scope and approval#
Fixes pingdotgg/t3code#17246
The VirtualBox and VMware host-only adapters from the same issue are handled separately by https://git.cafe/pingdotgg/t3code/pulls/25217 (by MAC address). This PR covers the other two gaps.
Verification#
vp test run apps/server/src/environment/DirectEndpoints.test.ts apps/server/src/startupAccess.test.ts: the two new tests inDirectEndpoints.test.ts(Windows hotspot adapter, including a localized name;utun40at 198.19.2.2 next to a Tailscaleutun4, which keeps its tailnet route) fail on the test-only commit dc004b4d77 and pass on the fix.startupAccess.test.ts"skips a VPN tunnel address for a private-network pairing URL" fails on d815c6c1f4 (expected 'http://198.19.2.2:3773' to be 'http://192.168.1.42:3773') and passes on the fix; the two test files pass 17/17.vp run check:changed: format, lint, knip, typecheck (3 packages) and tests pass.- Runtime:
t3 serve --host 0.0.0.0inside a network namespace (wlan010.172.46.2, dummyutun40198.19.2.2), paired from the web dev client through Settings → Connections → Add environment. Synthetic data only. Transcript.
| Before (main 36d4d711b7), fresh pair | After (fix 0833ff314a), fresh pair | After (fix), client that learned the route on main reconnects |
|---|---|---|
![]() | ![]() | ![]() |
The route-list UI is unchanged; only the server's advertised endpoints differ. Clients drop routes they learned earlier once the server stops reporting them.
Not verified:
cannot-verify windows: a native Windows host with Mobile hotspot on. Linux interface names cannot contain spaces, so the hotspot case is covered by the unit test only.cannot-verify macos: a real macOSutunfrom a VPN client. The 198.19.2.2 case was run on Linux with a dummy interface.
Model and harness: Claude Opus 5.5 (Claude Code) as lead, with reproduce and implement steps on Claude Opus 5.5 and reviews by GPT-6.1-Sol (Codex) and Claude Opus 5.5, running in T3 Code.
🤖 Generated with Claude Code
Takeover#
No code changes; evidence and verification added below. The earlier captures above were taken at 0833ff314a; the evidence below is at head 2061bd78a2 against merge-base 36d4d711b7, and adds the headless pairing-URL rows (R04–R08) that 2061bd78a2 introduced.
Evidence#
Captured R01–R08 on both SHAs (8/11 R rows); R09–R11 remain explicitly unit-only/platform-unverified. C01–C04 require no additional captures; unchanged controls were not newly runtime-verified. Environment: fs-04 Linux x86_64; Chromium 156 Preview; real HTTP web client and isolated Linux target CLI. 1440×1000 CSS px, light, DPR2, zoom100%, default16px font, no device emulation, scroll0. Saved whole-view PNGs1280×889 (Preview downsample); recordings2880×2000. Synthetic dummyVPN/Tailscale interfaces; no real tailnet/native platform claim. Conditions: display date2026-10-27T16:00:00Z fixed; reconnect deadlines use live Date.now (R01 fully frozen). Preview lacks reduced-motion emulation; app panel animations0. Fonts/network idle; both sides pass exact pixel equality for stills500ms apart. Metrics. Before target: 36d4d71; after target: 2061bd7. Same head web client; real target from each checkout. No repository edits. Diff0: exact absoluteRGB difference amplified16×. DiffT: per-channel difference>16/255, binaryRGB. All delivered stills/diffs/sheets and sampled recordings visually reviewed.
R01 —1440×1000/light; fresh pair; 5→3 routes. RPC/CLI. Labelled comparison sheet.
| Before —36d4d711b79c73eb33131944f73ea4a8c6156484 | After —2061bd78a2a0d6b5d9f8d4f93eeda0177a9ce15a | Diff0 —base→head | DiffT(16) —base→head |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
R02 scripted interaction (both recordings): 0–2 s connected, 5 routes; ~2 s stop the tracked target, await exit, restart on the same home; automatic reconnect without re-pairing. Before (control): back to 5 routes at ~22.4 s. After (upgrade): 3 routes at ~10.8 s, held ~1.5 s to the end of the recording. R02 —1440×1000/light; stable registration upgrade; 5→3 routes. RPC/CLI. Labelled comparison sheet.
| Before —36d4d711b79c73eb33131944f73ea4a8c6156484 | After —2061bd78a2a0d6b5d9f8d4f93eeda0177a9ce15a | Diff0 —base→head | DiffT(16) —base→head |
|---|---|---|---|
Before restart recording![]() | After upgrade recording![]() | ![]() | ![]() |
R03 scripted interaction (both recordings): 0–2 s connected, 3 routes; ~2 s stop the tracked target, await exit, restart on the same home; automatic reconnect without re-pairing. Before (control): back to 3 routes by ~13 s. After (upgrade): 1 route by ~20 s. R03 —1440×1000/light; empty advertisements; 3→1 saved route. RPC/CLI. Labelled comparison sheet.
| Before —36d4d711b79c73eb33131944f73ea4a8c6156484 | After —2061bd78a2a0d6b5d9f8d4f93eeda0177a9ce15a | Diff0 —base→head | DiffT(16) —base→head |
|---|---|---|---|
Before restart recording![]() | After upgrade recording![]() | ![]() | ![]() |
R02/R03 browser catalogs (safe origin/ID projection): R02-catalog.json, R03-catalog.json. Optional extra head390×844/dark, same browser/DPR2/no device emulation: R01-extra-head-390-dark.png.
| CLI row (viewport/theme N/A), before36d4d71 and after2061bd7 in each transcript | Result |
|---|---|
| R04 | Explicit198.18 and198.19 binds: requested pairing host retained, direct hints removed; explicitLAN retained. Windows explicit-hotspot subcase unit-only. |
| R05 | Managed/private true: VPN-first order; serve and pair select realLAN10.172.46.2 at head. |
| R06 | Managed/private true: tailnet100.101.102.103 fallback; only tailnet advertised at head. |
| R07 | Managed/private true: localhost fallback + pair local-only note + successful RPC[]. |
| R08 | Explicit wildcard/unrestricted: VPN pairing host unchanged; direct VPN hints removed. |
R09/R10: cannot-verify windows; R11: cannot-verify macos. Linux cannot reproduce native adapter enumeration. Unit-only log at head: unit-tests.log (2files/17tests pass); no native capture claimed. C01–C04: no extra capture required, prior unit/source-trace scope retained.
What else changed: R01/R02 count5→3; VPNrows removed; surviving learnedLAN/tailnet and Addroute rise96CSSpx; card shrinks and lower Loadbalancing/Pullrequestsharing sections rise96px. ManualLAN staysInuse; valid automatic labels remain. R03 count3routes→Routes; manualpublic moves3rd→1st and retainsInuse; last-route removeX disappears; header via203.0.113.2 becomes fullURL. Card/lowersections rise96px. During motion Reconnecting/Offline temporarily replacesConnected/Inuse. Exact diffs show no changes outside affected card/header and moved lowersections. No unrelated visible changes found.
Seeding/launch/RPC/CLI drivers: network-fixture.py, target-launch.mjs, rpc-capture.mjs, cli-matrix.mjs. Capture/rebuild/review details: ui-capture-protocol.md, wait-ready.mjs, compose-evidence.py, redact-transcripts.py.
Fixture matrix (proof audit pass 1): matrix.md. All uploads use synthetic network fixtures and fresh databases; pairing tokens are redacted.
Verification log
- Mode: evidence-only, round 1. No code changes, so no review rounds this round.
- Proof audit pass 1: 11 rows + 4 controls; R01–R08 capture rows, R09–R11 unit-only.
- Evidence capture: R01–R08 before/after on both SHAs; R09–R11 unit-only (17/17 in the two changed test files at head).
- Proof audit pass 2: R01, R03–R08 sufficient; R09–R11 accepted as unit-only. R02's narration claimed a final hold of at least 2 s, but the recording holds ~1.5 s; the narration above now states the measured times. The auditor rebuilt R05 (CLI/RPC) independently and its behaviour matched the delivered transcript.
- CI: 40/40 checks passing on 2061bd78a2, no conflicts.
- Unverified:
cannot-verify windows(native Mobile hotspot adapter enumeration, R04 explicit-hotspot subcase, R09, R10),cannot-verify macos(native VPNutunenumeration, R11). - Model and harness: Claude Opus 5.5 (Claude Code) as lead; proof audit and evidence capture on GPT-6.1-Sol (Codex), running in T3 Code.
- 1
- 2
Pushed4a9bab2
juliusmarminge added labelstakeover:blocked
juliusmarminge removed labelstakeover:in-progress
Sign in to join this conversation.














