{"id":"XE-16840","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"669","source_url":"https://github.com/xeprotocol/xe/issues/669","reporter_id":2920,"title":"[High] Competing multisig_open blocks cause a permanent, unresolvable consensus split","area":"consensus","claimed_tier":"high","assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-17T06:33:15.185202+00:00","updated_at":"2026-11-22T23:26:12.355114+00:00","source_created_at":"2026-11-17T06:32:22+00:00","told_at":"2026-11-22T23:26:12.407805+00:00","status_changed_at":"2026-11-22T23:26:12.367341+00:00","url":"https://bounty.xe.network/XE-16840","body":"## Summary\n\nTwo threshold-signed `multisig_open` blocks for the same account (same keyset, different timestamps → different hashes) delivered to different nodes partition the network permanently for that account. No recovery path exists: the fork is never recorded as a conflict, so quorum never sees it, and even a direct `SwapBlock` cannot promote the winner. Funds sent to the account are unspendable on the minority fork.\n\n## Root cause — two independent failure points, either alone is fatal\n\n1. **Staging rejects the fork outright, so no conflict is ever recorded.** `ValidateStagedBlock` (`core/ledger.go:3113-3114`) has an explicit case: `BlockMultisigOpen → \"staged multisig_open: conflicting account opens are invalid\"`. In `addBlock` (`:901-903`) this error returns before `recordConflict` (`:905`), so quorum never sees the fork, no votes are ever cast, and no resolution is ever attempted.\n2. **Even a direct `SwapBlock` cannot promote the winner.** `buildBlockUndo` of the loser open yields a non-nil *empty* overlay chain (`&AccountChain{Blocks: [:0]}`, `core/rollback.go:304`, via `cascade_commit.go:107-118`), and `validateAndAddMultisigOpen` (`core/ledger.go:1343-1345`) rejects *any* non-nil chain with `\"account already exists\"` — it never checks `len(chain.Blocks) == 0`. Contrast `validateAndAddReceive` (`:1170-1197`), which handles the empty overlay chain correctly (`Frontier()` of an empty chain is `\"0\"`), so regular account-open forks resolve fine.\n\n## Verification\n\nExecuted PoC (two fresh ledgers, 2-of-3 keyset):\n- Part 1: `AddBlock(O1)` ok; `AddBlock(O2)` → `conflict block: staged multisig_open: conflicting account opens are invalid`; `GetConflict(A, \"0\")` → nil; direct `SwapBlock(O1→O2)` → `SwapBlock: winner failed full validation ..., loser kept: multisig_open: account already exists`; frontier stays O1.\n- Part 2: second ledger accepts O2 and rejects O1 → L1 frontier O1, L2 frontier O2, SPLIT.\n- Part 3 (contrast): competing `multisig_update` forks stage as a conflict and `SwapBlock` succeeds, keyset correctly becomes K3 — proving the machinery works for updates but not opens.\n\n## Impact\n\nTrigger needs threshold-signed conflicting opens — malicious *or accidental* (there is no multisig support in `client/` or `cmd/`; members hand-construct opens, so two members racing to open the same account is realistic). Blast radius is one account + downstream dependents. Restart replays the same state; final votes for the other fork cannot be adopted (no `SwapBlock` path). Closest precedent for severity: #43 (High, accepted) — permanent per-account stall needing only the account's own signatures; this is strictly worse (cross-node split + invisible, no conflict recorded anywhere).\n\n## Note on related reports\n\nDistinct from:\n- #525 / #43 / #608 — descendant-type filter in `planSwap`/`planRollbackFrom`; my case has *no* descendants (the swapped block *is* the open, and `planSwap` succeeds).\n- #6 item 3 — multisig_update conflict deadlock; FIXED on HEAD via `keysetAtPrevious` + `RestoreKeyset` (proven by PoC Part 3). Opens are the remaining hole.\n- #566 — recorded conflict + quarantine livelock; here no conflict is ever recorded.\n- #394 / #552 — gossip delivery of multisig blocks.\n\n## Suggested fix\n\nAllow the second open to stage as a conflict (drop the `ValidateStagedBlock` rejection or special-case it), and make `validateAndAddMultisigOpen` treat an empty overlay chain (`len(chain.Blocks) == 0`) as \"account does not exist\" — mirroring `validateAndAddReceive`.","patch_refs":[],"thread":[{"id":18808,"source":"desk","source_ref":"reply:16485","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-16840 and says what differs; it is read like any other.","created_at":"2026-11-22T23:26:12.355114+00:00"}]}