Skip to content

Follow-Up Design Recommendations: Joining the Hoard by Invite

Reviewing docs/superpowers/specs/2026-11-23-join-by-invite-design.md @ 9c7a523 (after replacing the versioned PinnedSet with per-key approvals and permanent revocations — pin is already cleanly gone in 9c7a523).


1. Bind the invite signing key Into the Join Transcript (Security Fix)

Where: Joining a runner, steps 1, 3, 4, and 5 (lines 396–398, 420–436, 459–467).

Problem: invite appends a throwaway Ed25519 inviteSignPub to the invite so root in install.sh can verify the trust bundle (owner.pub, allowed, tailnet-peer) without trusting allmyram-runner. However, step 4 (lines 431–435) computes the fingerprint over the tailcat server key, pre-shared key, runner's throwaway node key, nonces, and step-3 messages — not inviteSignPub.

If an attacker swaps only the inviteSignPub suffix on an invite in transit: - tailcat ignores the suffix and connects the runner to the genuine laptop; - Both screens compute and display the exact same step-4 fingerprint; - On a rejoin of a host whose allmyram-runner user was compromised, allmyram-runner colluding with whoever swapped the suffix can sign a forged trust bundle (owner.pub, allowed-clients) with attackerSignPriv and pass root's verification in install.sh.

Recommendation: 1. Include inviteSignPub in the laptop's committed step-3 message and in the step-4 SAS hash input. 2. Have allmyram join verify that the laptop's revealed inviteSignPub matches the invite read on stdin before printing any fingerprint (failing immediately on mismatch). 3. State explicitly in step 5 that install.sh verifies the Ed25519 bundle signature and writes /etc/allmyram/runner.json (json.Marshal) by invoking a local, zero-network allmyram subcommand as root, rather than shell scripting.


2. Bound Stored Revocation Count Below the Wire Read Limit

Where: Removing and revoking (lines 602–604).

Problem: Line 602 states that revocations are read through a size limit (e.g., 64 KiB) wherever they are sent. If the writer (revoke / rotate-client-key / merge) does not also enforce a matching entry-count ceiling before saving (e.g., max 256 revocations, ~32 KiB serialized), a file that ever grew past 64 KiB could be written locally and then fail io.LimitReader on every subsequent connection and join.

Recommendation: Enforce an explicit entry cap (e.g., 256 revocations) when adding/saving revocations so any valid stored set is guaranteed to serialize well below the 64 KiB wire limit.


3. Make --join a Boolean Flag With Early Validation and TTY Prompting

Where: Goals (line 24) and Joining a runner, step 2 (lines 403–409).

Problem: - Line 24 writes --join while line 403 writes --join -. Since invites are never passed on argv anymore, - is redundant ceremony. - Requiring echo "<invite>" | sudo bash install.sh --join - records the invite in .bash_history / .zsh_history by default. - If the invite is only parsed when allmyram join runs after apt-get, gVisor extraction, and containerd setup, a truncated paste wastes 30–90 seconds before failing.

Recommendation: - Make --join a boolean flag (no - argument). - At the very top of install.sh / macOS allmyram install (before apt-get or VM setup): - If stdin is a TTY, prompt Invite: on /dev/tty and read a line (read -r); otherwise read one line from stdin. - Immediately parse and validate the invite format (tailcat.ParseAddr + inviteSignPub length/encoding) via a local allmyram check before touching packages or services.


4. Perform Early Day-Key Renewal in Client.Load, Not Inside connect()

Where: The day key (lines 355–371).

Problem: When allmyram run is invoked at an interactive terminal, its own os.Stdin is a TTY, whereas the allmyram git-ssh child process spawned by git push has pipes on stdin/stdout. If the < 8h early-renewal TTY check runs lazily inside connect(), git-ssh (which connects first, during git push) sees a non-TTY stdin and skips early renewal, while submit moments later sees a TTY and renews mid-command.

Recommendation: Run the day-key check/early-renewal once up front when loading client credentials (Client.Load at the start of allmyram run), before spawning git push. git-ssh then reuses the freshly signed client-cert.pub without prompting or diverging.


5. Add a Zero-Prompt Read-Only status / info Library & CLI Operation

Where: Operations are a library (lines 196–207).

Problem: With automatic 24h day keys, 8h early renewals, 30d host certs, and revocations, neither a terminal user (e.g., checking before leaving agents running overnight whether renew-day-key is needed) nor the future tracker UI has a non-interactive way to inspect credential health without risking a Touch ID prompt or parsing internal files.

Recommendation: Add a read-only ClientStatus library function + CLI command (e.g., allmyram status with no run ID, or allmyram info) that never calls Sign on the agent (zero Touch ID prompts) and reports: - whether owner.pub is currently listed by SSH_AUTH_SOCK; - remaining day-key / client-cert lifetime (or "expired"); - configured runners in client.json (optionally including each runner's last-seen host-cert ValidBefore cached on connect); - count of locally stored revocations.