Concepts

Isolation and security

What keeps a guest in, what it can reach, and how to run code you don't trust.

A Warm64 guest is held in by two layers: the emulated machine, and the WebAssembly sandbox the emulator runs in. Beyond those, the guest can only reach what you attach to it.

What keeps the guest in

  • The emulated machine. Guest code sees only the emulated CPU, its own RAM, and the devices on the command line. Its instructions are emulated, and none of them runs directly on the host.
  • WebAssembly. The emulator itself is WebAssembly. It can't touch files, the network, or any memory outside its own, except through the functions the host (your page or Node) gives it. The browser or Node checks every WebAssembly module before running it.
  • The browser. In a web page, all of this also sits inside the browser's sandbox for the tab.

What the guest can reach

Exactly what you attach, plus QEMU's default network card unless you leave it out:

You attachThe guest can
A disk (-drive)Read it, and write it unless it's readonly=on or snapshot=on. In Node, writes reach the file as they happen.
A 9p shared folderRead and write the files you put in the share.
A virtio-fs shareRead and write what its virtiofsd serves.
The user network in Node (there by default, or -netdev user)Open TCP and UDP connections to any address the host can reach: the internet, your local network, and the host's own 127.0.0.1 at 10.0.2.2. With hostfwd, accept connections from the host's network.
The user network in a browserReach only what your relay allows. Without a connector, its TCP connections are refused.
-netdev tap, bridge or vmnet-* (Node)Join the host's network as a machine of its own.
-netdev socketReach the other machines on that hub, and whatever they reach.

See Networking for the relay and its allow-list.

Running code you don't trust

  • In a browser, serve Warm64 from an origin of its own, with no logins, tokens or other secrets on it. Several cores need cross-origin isolation, which also gives the page SharedArrayBuffer and precise timers, so keep that origin free of anything worth reading.
  • In Node, run the process as an unprivileged user or in a container. Pass -nic none, because a machine gets the user network by default, or give the guest a relay with an allow-list.
  • Disks: attach them with readonly=on or snapshot=on when the guest shouldn't change them.
  • Monitors: a listening -qmp, -monitor or -chardev socket gives whoever connects control of the machine, as in QEMU. Put it on a Unix socket or on 127.0.0.1. The user network's guestfwd=…-cmd: runs a host command for each connection the guest makes, so only give it commands you'd let the guest run.
  • Limits: a guest can use all the CPU and memory you give it, so size -m and -smp with that in mind.
  • Updates: the WebAssembly and browser sandboxes belong to Node and the browser, so keep those up to date.

Status

Warm64 hasn't yet had an independent security audit, or fuzzing of its device emulation. Treat the layers above as defense in depth, not a guarantee.