Can a project user take wb-guestd's place on the host-guest socket?
Answered 2026-10-06: yes, with conditions. Source: X27-vsock-confinementX27-vsock-confinement: vsock confinement of project usersCan a non-root process in a macOS guest open AFVSOCK, and bind or listen on wb-guestd's port while wb-guestd is running or being restarted? (I101I101 (closed): X27-vsock-confinement: vsock confinement of project usersThe B29-vsock-handoff decision (#29) is that the host opens every host-guest connection.). Changes S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves., S06-vm-lifecycleS06-vm-lifecycle: VM Lifecycle, Images and the Guest AgentHow guest images are built, how VMs are kept warm, how projects and sessions map onto guests, and what wb-guestd does., 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… and S13-guest-confinementS13-guest-confinement: Guest ConfinementControls inside the guest that narrow what a project user's processes can do, and tell the host which program opened each connection.. Touches X20-shared-homebrewX20-shared-homebrew: Homebrew with more than one project userCan each project user in one guest get its declared Brewfile without a Homebrew prefix that another project user can write to (SEC08-proj-isolation)?, which has to work with project users who have no sudo. Found while deciding B29-vsock-handoffB29-vsock-handoff: Can wb-vmd hand guest connections to our Go daemons as descriptors, also across a restore?Yes, with conditions..
Figure 1. wb-hostd connects to wb-guestd’s port and trusts whatever answers, because wb-guestd vouches for the project user behind each request (S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves.). The design must stop the red flow, a project process that binds the port in the 12 ms while launchd restarts wb-guestd.
The fix the specs now state
Section titled “The fix the specs now state”The spike found the problem and measured two controls that each stop it. The specs take both, so that one of them failing doesn’t reopen the hole. An option the issue named, a check wb-hostd makes that a project user can’t fake, isn’t needed and isn’t in the specs.
Impact
Section titled “Impact”Evidence
Section titled “Evidence”- verified A standard user (uid 502, outside the
admingroup) creates vsock sockets, binds any free port from 1024 up, and connects to a host listener. Source: X27-vsock-confinementX27-vsock-confinement: vsock confinement of project usersCan a non-root process in a macOS guest open AFVSOCK, and bind or listen on wb-guestd's port while wb-guestd is running or being restarted?, “Answer” parts 1 and 2,results/matrix.jsonlon the spike branch. - verified Ports 1, 80 and 1023 fail with
EACCESfor both non-root users and work for root. Source: “Answer” part 2,results/matrix.jsonl,results/squat-1023-guest.jsonl. - verified While the daemon holds its port, every bind variant fails with
EADDRINUSE, for root too. Source: “Answer” part 3. - verified After
kill -9, the restarted daemon answers 11.5 to 18.2 ms later. A squatting project user got port 1024 and answered 410 host connections over 21.7 s, while the real daemon’s three restarts failed. Source: “Measurements”,results/gap-summary.txt. - verified
(deny system-socket (socket-domain AF_VSOCK))makessocket()fail withEPERM, also added to the agent-safehouse v0.12.0 profiles.(deny network*)alone leavessocket()working. Source: “Answer” parts 5 to 7,results/profiles.jsonl. - verified The port rule isn’t in Apple’s developer documentation, but the XNU source has it:
bsd/kern/vsock_domain.creturnsEACCESfor a port belowVSOCK_PORT_RESERVED(1024) unlessproc_suserpasses, which needs effective user ID 0. A later macOS that drops it fails the conformance check on that image (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…). - verified The spike’s project user stand-in had no
sudo. Its admin account could have become root and bound the port, so S06-vm-lifecycleS06-vm-lifecycle: VM Lifecycle, Images and the Guest AgentHow guest images are built, how VMs are kept warm, how projects and sessions map onto guests, and what wb-guestd does. now requires project users withoutadmin,wheelor a sudoers rule, and sealing fails on an enabled admin account or an added sudoers entry. Source: X27-vsock-confinementX27-vsock-confinement: vsock confinement of project usersCan a non-root process in a macOS guest open AFVSOCK, and bind or listen on wb-guestd's port while wb-guestd is running or being restarted?, condition 5. - assumed That X20-shared-homebrewX20-shared-homebrew: Homebrew with more than one project userCan each project user in one guest get its declared Brewfile without a Homebrew prefix that another project user can write to (SEC08-proj-isolation)? can work without
sudofor project users. The maintainer is to confirm this strict default.
What it unblocks
Section titled “What it unblocks”The wb-guestd contract 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"., the vsock RPCs of the walking skeleton (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…), and the Layer 2 profile work of S13-guest-confinementS13-guest-confinement: Guest ConfinementControls inside the guest that narrow what a project user's processes can do, and tell the host which program opened each connection., which now has a tested rule for vsock.
Details and glossary
Why the port matters. wb-hostd opens every connection to the guest (B29-vsock-handoffB29-vsock-handoff: Can wb-vmd hand guest connections to our Go daemons as descriptors, also across a restore?Yes, with conditions.). It can’t see which process answers, so it trusts that the process on wb-guestd’s port is wb-guestd. That daemon then names the project user behind each request. A process that takes the port could claim any project’s identity.
Why launchd restarts leave a window. launchd restarts a crashed daemon within milliseconds, but the port is free until then. If another process binds it first, the real daemon fails to start and launchd waits 10 s before the next try.
Why both controls. The port rule is enforced by the guest kernel for every non-root process. The Seatbelt rule keeps project processes off vsock altogether, which also covers any other guest port the host connects to later.
- vsock: the host-guest socket, a direct channel between the host and the guest that doesn’t go through the network.
- Bind: claim a port, so that connections to it reach your process.
- Seatbelt: macOS’s kernel sandbox. A profile lists what a process may do, and its children inherit it.
- launchd: the macOS service manager, which starts and restarts daemons.