← Blog
0.6.0 · security · sigil-os#12

Cap<NetSession>: Capability-Confined Network Sessions

June 22, 2026 · sigil-os · Sigil-Docs
security network capability 0.6.0

Cap<NetSession> (sigil-os#12, 098094a) brings network access under the sigilOS capability model. HP_NET_TOKEN is broker-held; the kernel injects it at the broker boundary; EL0 cannot forge it or escalate beyond its granted session. Network is now a held capability, not ambient.

Network panel in Lumen showing Cap<NetSession> authority
Network panel in Lumen — Cap<NetSession> authority visible

The problem: ambient network access

On a traditional OS, network access is ambient — any process with a socket syscall succeeds. There is no kernel boundary between "process that should reach the network" and "process that should not." The only check is the discretionary permission of the process owner, which is bypassed by any vulnerability that achieves code execution in the target process.

In sigilOS, the invariant is different: no EL0 code reaches the network without a held cap. A process without Cap<NetSession> cannot open a socket, resolve a name, or send a packet. The capability is not a permission bit that can be set — it is a kernel-injected token that EL0 cannot manufacture.


Cap<NetSession> — how it works

HP_NET_TOKEN is the broker-held network capability token. At session establishment, the broker grants a Cap<NetSession> handle to apps that are authorized for network access. The kernel injects HP_NET_TOKEN at the broker seam — EL0 only receives the session handle, not the token itself.

EL0 app
  │  holds: session handle (opaque u32)
  ▼
broker seam
  │  kernel injects HP_NET_TOKEN
  ▼
net dispatch
  │  checks: HP_NET_TOKEN present → route to stack
  │           wrong/absent        → EPERM
  ▼
network stack

Wrong or absent token returns EPERM immediately. The EL0 app never sees HP_NET_TOKEN — it only sees the result of the call (success or EPERM). There is no way to derive the token from the session handle.


What Cap<NetSession> gates

OperationSyscallGate
DNS resolvenet_resolveHP_NET_TOKEN → EPERM if absent
TCP connectnet_connectHP_NET_TOKEN → EPERM if absent
UDP sendnet_sendHP_NET_TOKEN → EPERM if absent
NET_LISTEN109HP_NET_TOKEN → EPERM if absent
NET_ACCEPT110HP_NET_TOKEN → EPERM if absent
NET_CLOSE112Session handle revocation

The Lumen network panel displays the session's cap grant as a visible chip — the user can see which sessions hold Cap<NetSession> and revoke them. Revocation calls NET_CLOSE (syscall 112) on the session handle; subsequent net calls from that session return EPERM.


SRDX remote desktop transport

The SRDX (Sigil Remote Desktop eXchange) transport (sigil-os#12 + kernel 0b932b9, syscalls 109–112) runs on top of Cap<NetSession>. The full syscall set:

SRDX uses NET_LISTEN on a fixed port to accept the desktop viewer connection, then routes compositor scene deltas over the session. Because SRDX runs under Cap<NetSession>, a compromised viewer process cannot escalate to arbitrary network access — its cap is scoped to the established session only.