fix(server): VirtualBox and VMware host adapters on Windows are no longer advertised as LAN routes #21056
main fromrefs/pull/21056/head·opened View on GitHubWildcard-bound Windows servers advertised VirtualBox and VMware host-only adapters as automatically discovered LAN routes. Windows connection names can be renamed or localized, so the existing interface-name exclusions miss them.
Rebuilt from @SunkenInTime's original contribution. The existing IPv4 filter now excludes 0a:00:27:* VirtualBox host-only MACs and 00:50:56:c0:00:* VMware VMnet host MACs on Windows. The service reads the current HostProcess.Platform dependency. Explicit binds, normal guest NICs, Tailscale classification and non-Windows bridge discovery keep their existing behavior.
VirtualBox's Windows driver builds the prefix from a locally administered guest OUI and the remaining bytes from the interface index. VMware matching follows its VMnet host-adapter convention; this is a heuristic, not a documented reserved range. A guest or Windows bridge using a matching MAC loses its automatically discovered route; an explicit bind still works. VM clients on the host-only network can add that route manually.
Scope is the server's automatically advertised direct endpoints, part of #17246. Desktop LAN-address selection and headless pairing-address selection are separate existing paths and remain outside this change. Mobile-hotspot and macOS VPN address policy also remain undecided.
Validation:
- 10 tests → 10 tests, one existing
DirectEndpoints.test.ts. Replaced redundant host-adapter fixtures, extended existing Linux bridge and explicit-bind cases, and retained four default guest-MAC ranges. - Reverting production to main fails exactly the Windows suppression test (two leaked addresses); the other nine pass. Production was restored byte-for-byte.
- Focused lint, formatting and server typecheck pass. Machine load was below 8 before starting typecheck.
- One independent review round with Claude Opus 5.5 and Codex GPT-6 Sol; neither found code defects.
Before/after production-service proof uses the actual DirectEndpoints.make → resolve() path on headless Linux, injecting Windows/Linux platform and network-interface fixtures. The same fixture has eight Windows routes on main and five on this head: LAN, Tailscale and three guest routes remain; one VirtualBox and two VMware host routes disappear. Explicit host-only binding and Linux output stay unchanged. Main was loaded from its source with only import locations adjusted for the scratch module. The unit regression uses two host fixtures; the service proof additionally includes both VMware VMnet1 and VMnet8.
No native Windows, real VirtualBox/VMware adapters, paired-client route persistence, packaged Electron, macOS, iOS or Android were verified during this takeover. The backend output is the evidence; there is no UI rendering change requiring screenshots. Native Windows adapter verification is left for a human.
Current-head test/build checks passed; a cancelled fingerprint run has a successful replacement. Macroscope correctness passed, but its automatic approvability check requires human approval because this changes default Windows route advertisement. This PR remains unmerged and blocked on that approval.
Implementation and test consolidation: Codex GPT-6.1 Sol / GPT-6 Astra in T3 Code through the Codex harness. Reviews: Claude Opus 5.5 and Codex GPT-6 Sol.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
45056be6-b231-4c73-a1fc-829e91f9ea54
📥 Commits
-
Reviewing files that changed from the base of the PR and between 0a4159117aff357993824743ac8788c019fdd92e and 2f82dcae7246e6ed55bc4347bb0257bec72b0f8a.
📒 Files selected for processing: 2
-
apps/server/src/environment/DirectEndpoints.test.tsapps/server/src/environment/DirectEndpoints.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
📝 Walkthrough
-
Endpoint resolution now receives the runtime platform. On Windows, it excludes VirtualBox and VMware adapters by MAC address, in addition to existing interface-name filtering. Tests cover Windows and Linux cases.
Changes: Endpoint filtering
Layer / File(s) Summary Platform-aware endpoint resolution
apps/server/src/environment/DirectEndpoints.ts,apps/server/src/environment/DirectEndpoints.test.tsmakepasses the runtime platform toresolveBoundEndpoints. Windows VirtualBox and VMware adapters are excluded by MAC address. Tests cover localized and renamed adapters, Linux bridge interfaces, Tailnet addresses, and existing endpoint cases.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
2f82d-
The Windows adapter filter is ready for normal merge checks; no merge-blocking issue was established.
Security architecture risk: ⚪ Minimal · up to
a2a6b-
The change only removes matching Windows virtual-adapter addresses from automatic route discovery. It does not expand network access, weaken authorization, or change the connection response format. No material security risk was found in the changed behavior.
Retained concerns No architecture-level concerns identified.
Security review details
-
Security Blast Radius
- inferred — The directly affected scope is automatic endpoint advertisement for wildcard-bound Windows servers with matching adapter MACs. The additional predicate only removes candidates; non-Windows resolution and explicit-bind selection do not gain destinations.
Trust Boundaries and Controls
- observed — The new predicate consumes local interface metadata and runtime platform information, not a new remote request parameter. The existing websocket configuration consumer remains within its authenticated-session context, and endpoint resolution does not bind or reconfigure listeners. MAC classification is a discovery heuristic, not an authorization control.
Resilience and Maintainability Implications
- observed — The Windows-only guard avoids applying the new MAC exclusion to Linux bridges that may inherit a member adapter's MAC. Existing Tailscale endpoint probing retains its timeout and failure fallback; the PR does not alter that recovery path.
-
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly and concisely describes the primary change: excluding VirtualBox and VMware host-only adapters from advertised Windows LAN routes. Description check The description explains the problem, implementation, scope, affected behavior, focused verification, limitations, and pending approval. It provides sufficient evidence for the required template secti… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Description check
-
Explanation
The description explains the problem, implementation, scope, affected behavior, focused verification, limitations, and pending approval. It provides sufficient evidence for the required template sections.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
juliusmarminge assignedjuliusmarminge
Taking over this one as maintainer for batch desktop-app-04. I will preserve the original commits, merge current main, rebuild the Windows host-adapter filtering with minimal behavioral coverage, and run separate test, implementation and adversarial review passes. This remains unmerged.
Closing in favour of #25217, which makes the same change. Thanks for the work here!
juliusmarminge closed this
Sign in to join this conversation.
Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — The server now changes its automatic wildcard-bound Windows endpoint list by omitting VirtualBox/VMware host-only MAC prefixes, while explicit binds and non-Windows paths remain unchanged. This is a default route-advertisement behavior change rather than an opt-in path.
Needs human approval because:
Notes:
- The correctness review was unavailable. Eligibility was assessed without its result.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).