How does wb-proxyd know which VM and name a stream belongs to, when wb-netd may be compromised?
Decided 2026-10-08: A. The decision is in the I68I68 (closed): wb-proxyd must bind stream identity to the connection, not to wb-netd's tagsFound in the security review of #65 (X23-sandboxed-daemons result). comment that starts Decision (2026-10-08):. The per-VM hand-off socket, the re-check and the narrowing header were decided on I68I68 (closed): wb-proxyd must bind stream identity to the connection, not to wb-netd's tagsFound in the security review of #65 (X23-sandboxed-daemons result). on 2026-10-04. This brief asked about how the spec fills them in. Source: I68I68 (closed): wb-proxyd must bind stream identity to the connection, not to wb-netd's tagsFound in the security review of #65 (X23-sandboxed-daemons result)., from the security review of X23-sandboxed-daemonsX23-sandboxed-daemons: Self-sandboxed Go daemons on macOSCan wb-netd, wb-proxyd and wb-hostd confine themselves at start with a sandbox profile, as S04-architecture says, while the Go runtime, inherited descriptors, and Keychain and Secure Enclave access in wb-proxyd keep w…. Changes S07-05-stream-hand-offS07-05-stream-hand-off: Stream Hand-offHow wb-netd hands each stream to wb-proxyd, and the checks that keep a compromised wb-netd from widening what a stream may reach., S07-07-hosts-and-modesS07-07-hosts-and-modes: Hosts and ModesHow wb-proxyd binds a stream to its name, which upstream addresses it refuses, and the inspect, pass and audit modes. (“Name binding”), S07-02-packet-pathS07-02-packet-path: Packet PathHow wb-netd carries the guest's frames: the packet transport, the stack, the link filter, its caps, addressing, the MTU and connections. (“Events and rate limits”), S04-02-vm-providerS04-02-vm-provider: VM Provider and StreamsHow wb-vmd hands guest connections and the NIC endpoint to other processes, the fixed device set of a VM, and where wb-proxyd takes a stream's identity from. and S11-verification-and-spikesS11-verification-and-spikesthe filter's fuzz properties, including one that replays the filtered output and the exit reset into a headless emulator and checks it is back in its initial state, and a conformance case that prints every dropped seq…. Follow-ups: I172I172 (closed): Measure the hand-off socket ordering and no-silent-drop properties on each host platformFollow-up from the code review of #170 (#68)., I173I173 (closed): Measure the delay of delivering an effective policy change to wb-proxyd before wb-netdFollow-up from the code review of #170 (#68)..
Figure 1. One hand-off socket per VM. wb-hostd creates it and tells wb-proxyd which VM it belongs to, so wb-proxyd never asks wb-netd. The red arrow shows what the X23-sandboxed-daemonsX23-sandboxed-daemons: Self-sandboxed Go daemons on macOSCan wb-netd, wb-proxyd and wb-hostd confine themselves at start with a sandbox profile, as S04-architecture says, while the Go runtime, inherited descriptors, and Keychain and Secure Enclave access in wb-proxyd keep w… spike allowed, where a header that wb-netd wrote named the VM.
Options
Section titled “Options”These are ways to fill in “its own copy of the DNS mapping”. Each keeps the per-VM socket you decided, and that socket keeps one VM’s streams away from another VM’s policy and credentials.
Impact
Section titled “Impact”Evidence
Section titled “Evidence”- verified The X23-sandboxed-daemonsX23-sandboxed-daemons: Self-sandboxed Go daemons on macOSCan wb-netd, wb-proxyd and wb-hostd confine themselves at start with a sandbox profile, as S04-architecture says, while the Go runtime, inherited descriptors, and Keychain and Secure Enclave access in wb-proxyd keep w… stand-in passed each stream as a socketpair end with
SCM_RIGHTSon an inherited Unix socket, at 438 MiB/s. Source: X23-sandboxed-daemonsX23-sandboxed-daemons: Self-sandboxed Go daemons on macOSCan wb-netd, wb-proxyd and wb-hostd confine themselves at start with a sandbox profile, as S04-architecture says, while the Go runtime, inherited descriptors, and Keychain and Secure Enclave access in wb-proxyd keep w…, “wb-netd: gVisor over inherited descriptors”. - inferred The new channels follow the rule S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves. sets for the
wb-vmdhand-off: one descriptor per message with fixed fields, refused when the count is wrong. That rule is a design, not built yet. Source: S04-02-vm-providerS04-02-vm-provider: VM Provider and StreamsHow wb-vmd hands guest connections and the NIC endpoint to other processes, the fixed device set of a VM, and where wb-proxyd takes a stream's identity from., “The VM provider passes descriptors, not bytes”. - verified macOS has no
SOCK_SEQPACKETfor Unix domain sockets:socketpairreturnsErrno 43 Protocol not supported. So the hand-off usesSOCK_DGRAMon macOS, as S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves. already allows. Source: a probe on macOS 27 for this brief, and the code review of PR170PR170 (merged): docs(spec): bind wb-proxyd stream identity to the hand-off socketWrites the #68 decision into the specs: wb-proxyd takes a stream's VM from the per-VM hand-off socket that wb-hostd creates and labels, re-checks the name against its own copy of the name mapping, the VM's effective…. - assumed That a Unix domain
SOCK_DGRAMsocketpair on macOS keeps message order and fails a send that doesn’t fit with an error, never dropping it. The design needs both, so that a name report arrives before any stream to its address. One probe for this brief sent 18 messages, received them in order, and saw the 19th send fail withENOBUFS. A buffer with room for two descriptors, sent three, setMSG_CTRUNC. That is one run, not a measurement. I172I172 (closed): Measure the hand-off socket ordering and no-silent-drop properties on each host platformFollow-up from the code review of #170 (#68). measures it on each platform. Until then the spec fails closed, and a send that fails answersSERVFAILor resets the connection. Result for macOS (I491I491 (closed): egress contract: the hand-off, control and accounting messages of wb-netd, wb-proxyd and wb-hostd, and the channel ordering testPackage M3.4 of docs/implementation-plan.md, part 1 of 4 (M3.4a).): the ordering test of C11-host-daemonsC11-host-daemons: Host Daemons, Audit, and DisksThe test cases for the host daemons' own checks: wb-vmd's device set and slots, the image build bundle, supervision, the accounting and event channels, the daemon log pipes, the audit writer, free space, and the data… sent 100,000 records of mixed sizes, every tenth with a descriptor, through a full channel and a slower receiver, and every record arrived once and in order. The channel queues 19 records of 4 KiB before a send fails withENOBUFS. - inferred A compromised
wb-netdcan still hand over a stream under any name its VM’s policy allows, within the wildcard budget, because onlywb-netdsees the guest’s DNS queries. Each option leaves that as it is. The spec lists the checks onlywb-netdmakes in “Only narrows”, and none of them lets a stream reach a name the policy refuses. - assumed That waiting for
wb-proxydto acknowledge each policy change beforewb-netdgets it doesn’t add a visible delay. No test or spike has timed policy delivery yet. I173I173 (closed): Measure the delay of delivering an effective policy change to wb-proxyd before wb-netdFollow-up from the code review of #170 (#68). measures it.
Also in the spec change
Section titled “Also in the spec change”These follow from the reviews of PR170PR170 (merged): docs(spec): bind wb-proxyd stream identity to the hand-off socketWrites the #68 decision into the specs: wb-proxyd takes a stream's VM from the per-VM hand-off socket that wb-hostd creates and labels, re-checks the name against its own copy of the name mapping, the VM's effective… and from the supervision work in I48I48 (closed): S04-architecture: process supervision, failure, version skew and host resource limitsS04-architecture names the processes but not how they are supervised, what happens when one fails, or how they are upgraded:. Approving the brief approves them too.
- Transport per platform.
SOCK_SEQPACKETon Linux andSOCK_DGRAMon macOS, with the ordering property I172I172 (closed): Measure the hand-off socket ordering and no-silent-drop properties on each host platformFollow-up from the code review of #170 (#68). measures. - A new socket at each restart.
wb-hostdmakes a new hand-off socket at each start and restore, and when it restarts that VM’swb-netd. A restart of the sharedwb-proxydgives every running VM a new socket. A restart keeps the generation, and that equal generation replaces the old socket.wb-proxydgets its end and acknowledges it beforewb-netdgets its end and before the VM runs. - Replay. On every new socket,
wb-netdfirst sends a name report for each live entry of its mapping. That rebuildswb-proxyd’s copy after awb-proxydrestart, and matches the kept copy after awb-netdrestart, whose mappingwb-hostdkept (I48I48 (closed): S04-architecture: process supervision, failure, version skew and host resource limitsS04-architecture names the processes but not how they are supervised, what happens when one fails, or how they are upgraded:). Messages are sent, retried and decided in order. A replayed or new report with a malformed name or an address outside the range ends thatwb-netd, as a malformed accounting record does. - Copy lifetime. The copy and
wb-netd’s mapping are cleared only at a start that isn’t a restore. Releases remove everything else, so a VM saved while idle keeps its guest’s cached answers. - Address reuse fails closed. A report for an address the copy holds for another name removes the old entry too and closes streams to it (
address-conflict). Entries leave the copy only whenwb-netdreleases them, so there is one clock,wb-netd’s. - Wildcard budget in both layers.
wb-proxydcounts the distinct names it accepted under wildcards, per VM and active period, and refuses over the budget. Each name goes towb-hostdas an accounting record, which keeps the set across awb-proxydrestart. Replays aren’t counted twice. - Bounds. Per-socket caps on open streams and undecided messages, a 4 KiB message limit, refusal of truncated messages and cut control data, and the new rules in the rate-limited classes.
- Policy order. Every change to the effective policy is applied and acknowledged by
wb-proxydbeforewb-netdgets it. Without the acknowledgment,wb-netdgets narrowing changes only.
What this unblocks
Section titled “What this unblocks”- The
wb-netdtowb-proxydcontract in I52I52 (closed): S04-architecture, S09-policy-credentials-audit, S10-tech-stack: first .proto contracts and settings schemaS04-architecture says all IPC is protobuf over gRPC and S10-tech-stack adds proto/ "with the first RPC". and the proxy work in V1-M2-walking-skeletonV1-M2-walking-skeleton: Walking skeletonwb-vmd boots a fixture VM bundle in its confined process, wb-guestd answers over vsock, a data disk made on the host holds the homes, and wb shell opens a PTY as a project user, with its output through the terminal fi….
Details and glossary
What a compromised wb-netd can still do. It sees every packet from its own VM and can break that VM’s traffic. Under option A it can’t give a stream a name its VM’s policy doesn’t allow, and it can’t reach another VM’s socket, because wb-hostd passed it only its own end. Each start, restore and daemon restart gets a new socket, and wb-proxyd closes the old one.
Why the label only narrows. Once X14-flow-attributionX14-flow-attribution: Guest flow attributionA Network Extension transparent proxy in a macOS guest (S13-guest-confinement): can it be approved during the image build without MDM? delivers labels, a stream message also holds the program and user the guest reported. Guest root can forge it (T06-forged-labelsT06-forged-labels: Forged program labels after guest rootAfter a guest root escalation, forged program identities in the guest confinement layer (S13-guest-confinement).). So a rule that uses it only takes access away.
Glossary
- Synthetic address: the made-up address in 198.18.0.0/15 that
wb-netdanswers a DNS query with. The guest never learns the real address. - Socketpair: two connected sockets with no file path, so only the processes that are handed an end can use them.
SCM_RIGHTS: the way one process sends an open socket to another over a Unix socket.- Generation: a number that names one run of a VM. Each restore starts a new one, and messages from an older one are refused.
- SNI: the host name a TLS client sends in the clear when it connects.