{"id":"XE-16507","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":2899,"title":"resolveMissingKeyset verifies against the latest keyset, not the keyset at b.Previous","area":"consensus","claimed_tier":"minor","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":true,"internal_ref":"","internal_url":null,"status":"triaging","closed_reason":null,"github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-17T02:20:58.905066+00:00","updated_at":"2026-11-22T23:26:19.071194+00:00","source_created_at":null,"told_at":"2026-11-22T23:26:19.076189+00:00","status_changed_at":"2026-11-22T23:26:05.110196+00:00","url":"https://bounty.xe.network/XE-16507","body":"Summary\nWhen the in-memory keyset is missing, the fallback resolver returns the *newest* keyset instead of the keyset as of the block's `Previous`. A fork block signed under a post-rotation keyset but building on a pre-rotation frontier passes credential verification on such a node.\n\nCode path\n- `core/ledger.go:1474-1520` (`verifyBlockCredential`), `keysetAtPrevious` vs `resolveMissingKeyset` (around lines 1540-1555).\n- `resolveMissingKeyset` returns `lastKeyset(chain.Blocks)` — the newest keyset — while `keysetAtPrevious` correctly returns the keyset as of `b.Previous`.\n\nImpact\nConsensus divergence: nodes with populated keysets reject the fork block, while a node with an empty keyset cache stages it and could promote it (swap re-runs the same credential check). No direct fund theft; the signers are legitimate members of the new keyset, authorized against the wrong generation.\n\nDistinctness\nDistinct from XE-0022 / XE-7898 / XE-13390 (unwind/cascade and case-dedup classes). This is the fallback path's keyset-generation selection, not the cascade or the dedup.\n\nNarrow window (stated honestly)\n`rebuildKeysets()` runs at startup (`ledger.go:389`) and open/update validation calls `setKeyset`, so the fallback rarely fires (store error at rebuild, or odd sync order). Reproducing it needs a node in that state plus a keyset rotation plus a fork — not reproducible read-only.\n\nSuggested fix\nResolve the keyset as of `b.Previous` in the fallback path too, the way `keysetAtPrevious` does.\n\nVerification\nCode-verified only.\n\nClaimed tier: Minor.","patch_refs":[],"thread":[{"id":18917,"source":"desk","source_ref":"reply:16594","author":"Joseph Denne","team":true,"body":"Thanks for the report. We have read the fallback that picks a keyset when the cached one is missing, and we are looking at it. The assessment and any award follow the fix.","created_at":"2026-11-22T23:26:19.071194+00:00"}]}