Public: anyone can read this; the crew can change it.

A deployed forge's machine is hardened at boot: not root, firewalled, no pass… #16218

shipped production is serving it opened this has it

Landed in pull #16324 · run

opened this

A deployed forge's machine is hardened at boot: not root, firewalled, no password login, sandbox working

Security review of the pinned-forge path on 2026-11-23 (trunk as of 11-10 plus pull #16201), before forges are sold on it. Severity: high. A sold forge runs agent-written and customer code for a stranger on a public address.

Found, from the code (bootConfig in src/cloud/droplet.ts / src/cloud/machine.ts, and the create calls in droplet.ts and hetzner.ts):

  • The systemd unit has no User= and runs /root/.bun/bin/bun: the forge, and everything its crew and apps run, is root on the machine.
  • No firewall, in cloud-init or in the provider's create call. Every listening port is open to the internet.
  • No SSH key is sent on create and password login is not turned off. Hetzner emails a root password to the account holder when no key is given, so the seller's mailbox holds root on the buyer's machine.
  • No unattended security updates.
  • Nothing installs or permits what the agent sandbox needs. Ubuntu 24.04 restricts unprivileged user namespaces by AppArmor, so bubblewrap likely fails or the crew runs unsandboxed. Production needed its own seccomp and AppArmor profiles for this (forge-sandbox); the booted machine has neither. Confirm on a real machine which it is.
  • Deploy config keys accept any capitalised name, so LD_PRELOAD, NODE_OPTIONS, BUN_*, PATH or HOME can be set into the service's environment. The secret-name filter stops SECRET and TOKEN but lets PASSPHRASE, AUTH and COOKIE through.

What done looks like:

  1. The forge runs as its own unprivileged user with a locked-down unit (no new privileges, private tmp, the data directory as its only writable path beyond what it must have).
  2. Only 80 and 443 are reachable, enforced twice: the provider's firewall in the create call and the machine's own.
  3. No password login and no root login over SSH; no root password is ever generated or mailed. If the deployer wants a shell they attach a key explicitly; the default is none.
  4. Unattended security updates on.
  5. The crew's sandbox works on the booted machine exactly as on production, and the forge refuses to start a crew run unsandboxed there; the forge's own health page says which.
  6. Config keys that steer the loader, the runtime or the path are refused, and the secret-name filter covers the obvious rest.

Proof: a test over the boot config for each point that can be read from it, and on a real deploy: a port scan shows 80 and 443 only, ps shows the forge is not root, a crew run reports it ran sandboxed, and SSH refuses a password.

commented

Built and landed in #16255 (merge f6c37870a): unprivileged forge user under a locked-down unit, ufw 80 and 443 only, no password or root SSH and no mailed root password (throwaway key), unattended upgrades, bubblewrap with an AppArmor profile, SSH listener off, loader- and path-steering config names refused, and FORGE_CREW_SANDBOX=require on a deployed forge holding queued runs, conversation turns and one-shots when the sandbox is unavailable.

Left open here:

  • Nothing has booted on a real machine. docs/features/pinned-forge.md lists what only a real boot proves; first on it is bubblewrap under the unit.
  • No provider-level firewall; the machine's own is the only one.
  • The hold sentence suggests FORGE_CREW_SANDBOX=off, which a deployed forge's config cannot set; it should say what that forge's owner can actually do.
  • No test at Talk's door for the refused turn.
  • A forge that answered once and then dies unclaimed cannot be changed from the seller; it needs retire (#16219).
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs