Repository navigation
Description
id(world/signed): sign_move never checks world_id or input against the acceptance domain — a move for a blank world, or with an empty input, signs Ok yet no world can ever accept it
Summary
crate::world::signed::sign_move (pkgs/id/src/world/signed.rs:67) is the player-side signing entry point for world moves (#2814): the player signs each move with their own key before submitting it, and the world verifies at the input seam. It forwards world_id and input to chain::sign after no domain check of its own — chain::sign validates only the extension shape and the seq/backlink pairing. Two values that the acceptance side refuses unconditionally therefore sign Ok:
- A blank
world_id(""," "," ","\t").WorldCore::new_with_clockrefuses any world whose ID is empty once trimmed —ensure!(!world_id.trim().is_empty(), "world ID must not be empty")(pkgs/id/src/world/core.rs:291) — so no world can ever bear a blank ID.sign_movehashes whatever string it is given into the signed extension's group (world_group, signed.rs:53), producing a well-formed, signature-valid move for a world that cannot exist. - An empty
input.sign_movesigns it Ok, but the resulting header carries no payload hash at all (payload_hash: None— an empty body is no body to the header builder), soMoveChain::verify's commitment check (payload_hash == Some(Hash::digest(input)), signed.rs:154) refuses the move with the misleading reason "signed move does not commit to the submitted input bytes" — the signature is genuine; the move is simply uncommittable. And the production path never gets that far:WorldCore::prepare_input_signed(core.rs:1925) refuses empty input before verify —ensure!(!input.is_empty(), "world input must not be empty")(core.rs:1938; the unsignedprepare_inputhas the same rule at core.rs:2042).
In both cases signing succeeds silently and the failure only surfaces later, detached from the mistake — the same dead-on-arrival pattern as #6422 / #6424 / #6434 / #6441 / #6443 in sibling sign_* entry points. For the blank world the gap is widest: MoveChain::verify (signed.rs:154) happily verifies the move against the same blank ID, so the refusal lives only in WorldCore's constructor, which the signing side never consults.
Evidence (main @ 9e20032, laptop probe with the real id crate)
Probe: laptop worktree ~/git/fleet/probe-sign-move-wt at origin/main 9e20032, integration test pkgs/id/tests/probe_sign_move.rs (real crate, cargo test --test probe_sign_move):
- Acceptance-side oracles:
WorldCore::new("", WorldLimits::default())errs;WorldCore::new(" ", …)errs;WorldCore::new("ttt", …)is Ok. - Control:
sign_move(key, "ttt", 0, None, b"cell-0")signs Ok andMoveChain::verifyaccepts it. - Blank worlds:
sign_movereturns Ok for""," "," ","\t", andMoveChain::verifyagainst the same ID also returns Ok for each — a move that verifies in isolation yet can never be accepted by anyWorldCore. - Empty input:
sign_move(key, "ttt", 0, None, b"")returns Ok withheader.payload_hash = None;MoveChain::verify(…, b"", …)returns Err("signed move does not commit to the submitted input bytes") — andprepare_input_signedwould refuse the empty input at core.rs:1938 before verify in any case. Probe test result: 1 passed.
Code reads (origin/main 9e20032):
pkgs/id/src/world/signed.rs:67-91—sign_movebuildsChainExt { kind: MOVE_KIND, group: Some(world_group(world_id)), … }and callschain::signwithSome(input); no check onworld_idorinput.pkgs/id/src/world/core.rs:291— the world-ID domain rule at construction.pkgs/id/src/world/core.rs:1934-1949—prepare_input_signedchecksinput.len() <= limits.input_bytesand!input.is_empty()beforechain.verify(signed_move, &self.world_id, input, &author).
Out of scope, deliberately: input length is per-world (limits.input_bytes, default 16 KiB) and sign_move cannot know the target world's limit, so no length claim is made here; seq/backlink consistency is already refused by chain::sign.
Why it matters
Signed moves are the evidence base for match attestation (#2814, #3792): a witness replays both players' signed move logs. A signing API that mints signature-valid moves outside the acceptance domain pushes a preventable, deterministic failure to the worst place — submission/replay time, where it reads as a broken move rather than a caller bug at the signing call. Every sibling sign_* surface in pkgs/id that has been audited for this pattern now refuses at sign time (artifact #5623 symmetry, currency #6422, attestation #6424/#6441, match_audit #6434, directory_auth #6443); sign_move is the remaining one whose acceptance domain is stated in the same crate and ignored.
Acceptance criteria
sign_moverefuses aworld_idthat is empty or whitespace-only, matching theWorldCoreconstruction rule (core.rs:291), with an error that names the rule; it refuses an emptyinput, matchingprepare_input_signed/prepare_input(core.rs:1938 / :2042).- Pinning tests cover at least:
""," "and"\t"world IDs refused; empty input refused; the control move ("ttt",b"cell-0") still signs and passesMoveChain::verify; existing seq/backlink refusals fromchain::signunchanged. - Triage decides whether
MoveChain::verifyshould also refuse the same values (defense in depth for the witness-replay path, id: persist signed-move bindings/frontiers in the world journal + ingest signed moves into the event store (#2814 follow-up) #4346) — the sign-side refusal is the minimum fix. cargo test -p id --lib world(or the world test module's filter) passes on the laptop / in CI.
Related: #2814 (signed move capture), #3792 / #4346 (attestation + signed-move ingest), #5711 (the same "names no world can bear" pattern on the serve side). Sibling sign-domain issues: #6422, #6424, #6434, #6441, #6443.
Activity
developing-today commentedon Nov 6, 2026
CODE-1936
dezren39 commentedon Nov 6, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 6, 2026
🤖 Agent note · handed off
22 remaining items
dezren39 commentedon Nov 11, 2026
🤖 Agent note · picked up — task 10899 (issue #6447)
queue/10899-6447-sign-move-domainon the laptop; implementation + tests in progress per the triage note above.fix(id/world): refuse blank world_id and empty input in sign_move (#6447
fix(id/world): MoveChain::verify refuses blank world_id and empty inp…
Merge pull request #6544 from developing-today/queue/10899-6447-sign-…
dezren39 commentedon Nov 11, 2026
🤖 Agent note · done (fixed_merged) — task 10899 (issue #6447)
ChainError::BlankWorldId/EmptyInputsign-side refusals) was shepherded by this lane: rebased onto current main, plus the salvagedMoveChain::verifydomain refusal from the duplicate implementation (salvage note on PR fix(id/world): refuse blank world_id and empty input in sign_move (#6447) #6544, comment 6785670987; triage decision on this issue above).cargo test --lib worldin pkgs/id — 648 passed / 0 failed;world::signedunit tests 5/5 (blank IDs, empty input, control, seq/backlink, verify-side refusals); Codex review at the merged head completed with no findings.dezren39 commentedon Nov 11, 2026
🤖 Agent note · done (already_done)
pkgs/id/src/world/signed.rssign_moverefuses blank/whitespaceworld_idwithchain::ChainError::BlankWorldIdand empty input withchain::ChainError::EmptyInput, with refusal tests in the same file (lines ~251/260); task 10899's closing note recordscargo test --lib world648 passed / 0 failed and a clean Codex review at the merged head.