GeezerVison is showing github.com — id(issuer_rotation): sign_rotation never checks the successor against the signer — a routine rotation to the signing key itself signs Ok yet the fold can never count it · Issue #6451 · developing-today/code
id(issuer_rotation): sign_rotation never checks the successor against the signer — a routine rotation to the signing key itself signs Ok yet the fold can never count it #6451Descriptionid(issuer_rotation): sign_rotation never checks the successor against the signer — a routine rotation to the signing key itself signs Ok yet the fold can never count it
Summary
crate::issuer_rotation::sign_rotation (pkgs/id/src/issuer_rotation.rs:711) signs any routine rotation whose successor is the signing key itself. That rotation is dead on arrival in every chain state, by the fold's own rules (fold_rotation_chain, issuer_rotation.rs:579):
- a routine transition counts only when its author is the current generation key (:608,
RotationMode::Routine => *author == current_key);
- a transition whose successor is the key it replaces never counts (:614,
rotation.successor_key != current_key) — "it would change the generation without changing the key".
When successor_key == issuer_id(signing key), both filters fire together wherever the signer is current, and the author filter fires everywhere else. The rotation can never advance any generation chain, yet:
sign_rotation produces it Ok — it has the signing key, so the author is known at sign time, but it never compares rotation.successor_key to issuer_id(key);
IssuerRotation::validate (:354) passes it — its stateless rules (shape, predecessor, asserted-compromise, successor proof, recovery author) contain no successor-vs-author rule; the only place the rule exists is the fold's filter at :614, which discards silently;
- the chain boundary check
check_rotation (:102, the id(chain): ChainExt::validate never checks the issuer-rotation body — every other payload kind gets its check_*, rotation gets (true, Some(_)) => {} #5706 fix) cannot catch it either — it deliberately has no author context (its own doc comment says so).
So the one layer that knows both the author and the body — sign_rotation — is the one layer that doesn't check. This is the same dead-on-arrival pattern as #6422 / #6424 / #6434 / #6441 / #6443 / #6447 in sibling sign_* entry points, narrowed to the one author-local rule those layers missed: the recovery-mode analogue (successor == the compromised key being replaced) is not claimed here, because sign_rotation's caller-visible inputs do not name the replaced key.
Evidence (main @ 9e20032, laptop probe with the real id crate)
Probe: laptop worktree ~/git/fleet/probe-rotation-self at origin/main 9e20032, integration test pkgs/id/tests/probe_rotation_self.rs (cargo test --test probe_rotation_self, 1 passed):
- Control: routine rotation gen0 → gen1 (unsigned +
prove_successor(gen1)) signs Ok; fold_rotation_chain over the signed event advances: keys=2, transitions=1.
- Case: routine rotation gen0 → gen0 — successor is the signer's own key — countersigned by gen0 via
prove_successor: validate(&issuer, None) is Ok, sign_rotation returns Ok, but the fold over the signed event never advances: keys=1, transitions=0, active_generation=0.
Code reads (origin/main 9e20032):
pkgs/id/src/issuer_rotation.rs:711-733 — sign_rotation forwards the rotation to chain::sign with no successor/author comparison.
pkgs/id/src/issuer_rotation.rs:606-614 — the fold's candidate filters: validate(...).is_ok(), routine author == current_key, and successor_key != current_key.
pkgs/id/src/issuer_rotation.rs:354-385 — validate has no successor-vs-author rule.
pkgs/id/src/issuer_rotation.rs:96-116 — check_rotation doc + body: body-only subset, author context explicitly out of scope.
Why it matters
A self-rotation is the most likely fat-finger in the rotation API: a caller that builds the successor from the wrong key variable (or re-uses the current key while wiring a ceremony) gets a fully signed, signature-valid, proof-valid event that every observer's fold silently discards. The failure surfaces only as "the rotation never took effect", detached from the signing call that caused it — and in a compromise-recovery drill or a real rotation, a silently void transition reads as a chain that refused to move for unknown reasons. Refusing at sign time costs one comparison the signer already has both sides of.
Acceptance criteria
sign_rotation refuses a RotationMode::Routine rotation whose successor_key equals the signing key's issuer id (crate::currency::issuer_id(key)), with an error naming the rule (a new RotationError variant or the existing SignError surface, triage's choice); no event is produced.
- Pinning tests cover: routine self-rotation refused at sign time; the gen0 → gen1 control still signs and folds to generation 1; a
CompromiseRecovery rotation whose successor is the recovery (signing) key is unaffected (that form is not fold-dead — only the routine self-replacement is claimed here).
- Triage decides whether
validate should also gain the author-side rule (it receives author, so the same comparison is available there) — sign-side refusal is the minimum fix.
cargo test -p id issuer_rotation (or the module's test filter) passes on the laptop / in CI.
Related: #2804 (rotation design), #5526 (implementation), #5706 (chain-boundary body check). Sibling sign-domain issues: #6422, #6424, #6434, #6441, #6443, #6447. Activitydeveloping-today commented on Nov 6, 2026 added kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item app/idPackage/app: id (pkgs/ or apps/ in this repo) on Nov 6, 2026dezren39 commented on Nov 6, 2026 🤖 Agent note · filed
- Agent: new-issue-creator-code-b (Lane B, developing-today/code)
- Session / ID: cron new-issue-creator-code-b run 2026-11-06T05:50Z
- Found via: filed this run
- Task: Filed after verification on the laptop: probe
~/git/fleet/probe-rotation-self (real id crate, origin/main 9e20032) — a routine rotation to the signing key itself passes validate and signs Ok, yet fold_rotation_chain never advances (keys=1, transitions=0); the gen0 → gen1 control folds to generation 1.
- Expectation: effort/s — one author-local comparison in
sign_rotation (plus pinning tests); packet enqueued for triage on queue repo-health-code-pilot.
- Links: packet packet-6451-triage.json (goal hidden_files)
dezren39 commented on Nov 6, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 6, 2026 🤖 Agent note · picked up / merging
dezren39 commented on Nov 6, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|