AI Focus

messageport container mesh

Why this matters

Putting untrusted input processing and sensitive secrets inside one shared Linux container gives any compromised shell command ambient read access to sibling files. This lab boots two completely separate Unkernel Linux 7.x kernels (ingest-vm and vault-vm, 96 MiB RAM each) in separate Dedicated Workers with zero external network interfaces, linked only by a policy-mediated MessageChannel—and includes an Unfiltered Naive Relay switch to test what breaks when channel policy enforcement is removed.

What this opens up

Zero-server multi-container pipelines directly in a browser tab using standard POSIX tools (sh, awk, sha256sum): Container A pipes untrusted CSV files from /work through /run/kw/bin/port-call compute_totals, Container B computes aggregates against private tables in /vault without exposing /vault/canary-secret.txt, and one click closes both ports with 410 PORT_REVOKED.

How the tests work

  1. Click 1. Boot Both Containers to start ingest-vm (/work) and vault-vm (/vault) as two independent Linux 7.x WebAssembly kernels and verify distinct hostnames, PIDs, mount trees, and loopback-only networking.
  2. Click 2. Run Cross-VM Pipe to execute sh -c "cat /work/raw-orders.csv | port-call compute_totals" inside Container A and observe Container B run real Linux awk and sha256sum against /vault/pricing.json.
  3. Click 3. Fire All 3 Attacks in Policy-Mediated Broker mode to verify ENOENT on /vault, 403 POLICY_DENIED on port-call read_secret, and zero-network failure on wget—then flip the toggle to Unfiltered Naive Relay and re-run to observe live canary exfiltration.
  4. Click 4A. Revoke Port to close both MessagePort ends immediately (410 PORT_REVOKED), reconnect a fresh MessageChannel without rebooting Linux, and click 4B. Run Benchmark to compare cloned JSON against zero-copy transferable ArrayBuffer transfers (byteLength === 0 detachment proof).
Two independent Unkernel Linux 7.x kernels running in separate Dedicated Workers with zero external network, connected exclusively through a policy-mediated MessageChannel broker with live revocation and transferable ArrayBuffer benchmarks. Open messageport container mesh full screen ↗

Hypothesis

Splitting untrusted ingestion and private vault computation across two zero-network browser Linux 7.x VMs prevents cross-container secret exfiltration ONLY when the connecting MessagePort is mediated by an explicit operation allowlist, argument path guard, and canary egress filter.

What confirms it: Direct cat /vault/canary-secret.txt inside Container A returns kernel ENOENT, wget fails with loopback-only networking, port-call read_secret returns 403 POLICY_DENIED, cat /work/raw-orders.csv | port-call compute_totals returns aggregated totals from Container B’s awk/sha256sum, and port.close() cuts off traffic with 410 PORT_REVOKED.

What bounds or disproves it: Flipping the broker mode to Unfiltered Naive Relay allows port-call read_secret /vault/canary-secret.txt from Container A to exfiltrate CANARY_VAULT_SECRET_9f83c1a4_DO_NOT_EXFILTRATE across the MessagePort, proving transport separation without frame policy enforcement is insufficient.

Under the hood

MessagePort Container Mesh (GitHub) instantiates public/container-worker.js twice in separate Dedicated Workers, booting two independent Unkernel Linux 7.x kernels (memoryMiB: 96 each, zero external network devices):

  • Container A (ingest-vm) mounts MemoryFs at /work (raw-orders.csv, README.md) and registers /run/kw/bin/port-call and /run/kw/bin/port-ping host commands that forward stdin and arguments as structured RPC frames over its MessagePort.
  • Container B (vault-vm) mounts private MemoryFs at /vault (pricing.json, canary-secret.txt), receives validated RPC frames on its MessagePort, executes real Linux /bin/awk and /bin/sha256sum inside the guest against /vault/pricing.json, and returns only aggregated totals and payload digests.
  • Port Broker (public/lib/port-broker.js) mediates the MessageChannel pair between both workers, enforcing an explicit operation allowlist (compute_totals, hash_payload, health), blocking traversal or /vault arguments (403), scanning egress responses for canary strings, recording every frame in the wire audit log, and closing both ports immediately on revocation (410 PORT_REVOKED). Switching the broker to Unfiltered Naive Relay bypasses policy validation so readers can test the falsification signal directly against canary-secret.txt.

Key terms & further reading

Unkernel (Linux 7.x on WebAssembly) ↗
An aarch64 Linux 7.x kernel compiled to WebAssembly that runs standard POSIX userland binaries (sh, awk, sha256sum) inside a browser Dedicated Worker with zero server compute.
WebAssembly JSPI (WebAssembly.Suspending) ↗
JavaScript Promise Integration allows synchronous WebAssembly kernel execution to suspend cleanly on asynchronous host I/O such as 9p virtual filesystems and host command bridges.
MessageChannel & MessagePort ↗
A transferable pair of capability ports defined by the HTML Standard that establish a private point-to-point channel between two Dedicated Workers and terminate immediately on port.close().
Transferable ArrayBuffer ↗
Passing an ArrayBuffer in the postMessage(msg, [buf]) transfer list moves ownership across workers without copying bytes, detaching the sender buffer (byteLength === 0).
Unkernel Host Commands (/run/kw/bin/*) ↗
Virtual binaries mounted on the guest $PATH that bridge Linux stdin, stdout, stderr, and argv over vsock into host JavaScript handlers.
Dedicated Worker Isolation ↗
Each Dedicated Worker runs in an isolated JavaScript realm with its own linear WebAssembly.Memory and MemoryFs tree, preventing Container A from referencing Container B’s /vault.

Open questions

  • How does two-VM memory overhead (~192 MiB total for two 96 MiB kernels) scale on constrained mobile devices if a workflow needs three or four isolated container stages?
  • Could streaming ReadableStream transfers over MessagePort replace buffered ArrayBuffer frames for multi-megabyte Linux pipeline payloads?

Iteration log

  • — Initial deployment: two real Unkernel 0.3.0-261202-b033dc7 Linux 7.x Dedicated Workers (ingest-vm and vault-vm), pure port-broker.js policy gate with switchable Unfiltered Naive Relay mode, live port.close() revocation, transferable ArrayBuffer benchmark, and 12 automated tests including two-VM Node integration.

Primitives tested: Unkernel Linux 7.x, WebAssembly JSPI, Dedicated Worker, MessageChannel, Transferable ArrayBuffer, MemoryFs (9p).

This is an active lab under /labs/ and stays off the main RSS feed until graduated into a full essay.

More in browser-delivered vms & container fabrics

Connected labs

← browser-delivered vms & container fabrics · All labs