Skip to content

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..

wb-hostdconnects to the portguest (untrusted)wb-guestdroot, restarted by launchdproject processnot rootvsock portbelow 1024: root onlytrusts who answersbind during the restart

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 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.

RequirementA. Port and ruleB. Rule only
SEC08-proj-isolationSEC08-proj-isolation: Per-project isolationEach project has its own guest user, state and history, and one project cannot persist into another. one project can’t act as anotherno project process can take the portprocesses outside the profile can
SEC06-repo-writesSEC06-repo-writes: Repository-scoped writesGit pushes and repository-mutating API calls are allowed only for the repositories of the projects that have a session in the VM. the guest pushes only to its own session branchesno impostor can push as another projectprocesses outside the profile can
SEC10-auditSEC10-audit: AuditEvery egress decision, approval, and returned change is recorded on the host in a persisted log the guest cannot alter. every request attributed to its projectonly wb-guestd answerssame gap as above
SEC11-root-gains-nothingSEC11-root-gains-nothing: Guest root is not a privilegeFull control of the guest grants no control over enforcement, secrets, or policy. guest root is not a privilegeunchanged: root can still bind, as beforeunchanged

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.