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

A deployed forge can be claimed, only by the person it was deployed for, and… #16217

shipped production is serving it opened this has it

Landed in pull #16255

opened this

A deployed forge can be claimed, only by the person it was deployed for, and only over HTTPS

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. It blocks every real deploy, including the first test.

Found, from the code:

  • The boot config (bootConfig, src/cloud/droplet.ts, moving to src/cloud/machine.ts in #16201) installs Bun, clones the source and starts the service. It never mints a first-admin code. src/core/first_admin.ts says a code is minted only by bun src/main.ts --first-admin in the operator's terminal, lives 15 minutes and is "never reachable over the web". So the header comment "the new forge's first visitor claims it at /first-admin" matches no code: a deployed forge has no admin and no way to get one without a shell on the machine, and the deploy sends no SSH key.
  • The address handed back is http://<ip>:<port>/ (urlOf in src/core/pinned.ts). A passkey claim needs a secure context, so it could not work on a bare address over plain HTTP even with a code.
  • If this is patched as "first visitor wins", anyone scanning new cloud addresses claims the buyer's forge before the buyer does.

What done looks like:

  1. A deploy carries a claim made for one person. The claim link works once, expires, and is the only way to become the first admin; a visitor without it gets nothing and learns nothing. Reuse the spawn claim's shape (src/spawn/claim.ts) rather than a second mechanism.
  2. The machine holds only a hash of the claim, never the claim itself: cloud-init user data is readable afterwards through the provider's API and the machine's metadata endpoint, and it stays in the seller's account.
  3. The claim is only ever served and redeemed over HTTPS on the forge's own name (the name and certificate come from #16204). Until then the forge's port is closed to the world. No claim page over plain HTTP, ever.
  4. A claim that expires unused can be reissued by the deployer, and the old one is dead.
  5. The header comments say what the code does.

Proof: tests that a deployed forge refuses a first admin without the claim, accepts it once, refuses it a second time and after expiry, and that the boot config contains no value from which the claim can be derived. Then the real journey: deploy, open the link as a stranger, become admin; a second browser with no link is refused.

commented

Built and landed in #16255 (merge f6c37870a): a deploy takes a hostname and answers once with a claim link; the machine and the seller hold only its sha256 and deadline; the forge is served only over HTTPS on its own name; a reissue replaces the server and is refused once the forge says it was claimed. Two adversarial reviews; the forge's full check passed on the head before the last merge of main, and 347 targeted tests passed on the merged head.

Not proven yet: nothing has booted on a real machine. This stays open until the stranger's journey passes on a real deploy (claim link opens over HTTPS, a second browser without it is refused).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs