resolveMissingKeyset verifies against the latest keyset, not the keyset at b.Previous
Report
Summary
When 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.
Code path
core/ledger.go:1474-1520(verifyBlockCredential),keysetAtPreviousvsresolveMissingKeyset(around lines 1540-1555).resolveMissingKeysetreturnslastKeyset(chain.Blocks)— the newest keyset — whilekeysetAtPreviouscorrectly returns the keyset as ofb.Previous.
Impact Consensus 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.
Distinctness Distinct 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.
Narrow window (stated honestly)
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.
Suggested fix
Resolve the keyset as of b.Previous in the fallback path too, the way keysetAtPrevious does.
Verification Code-verified only.
Claimed tier: Minor.
Thread
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.