[HIGH] core: Cross-position vote candidate injection lets any positive-weight representative permanently lock FinalVoteStore on a foreign block hash and brick account finality
Report
Summary
QuorumManager.finalTally (core/quorum.go:120-123) verifies that a FINAL vote's BlockHash belongs to the target conflict slot (account, previous) before counting its weight toward the 67% finality threshold:
b := qm.ledger.GetBlockOrStaged(v.BlockHash)
if b == nil || b.Account != account || b.Previous != previous {
continue
}
However, VoteManager (core/vote.go and core/finalization.go) never checks that v.BlockHash (or any candidate hash h gathered for (account, prev)) actually belongs to (account, prev). In addition, QuorumManager.finalTally (core/quorum.go:112) records candidateSet[v.BlockHash] = true before checking b.Account != account || b.Previous != previous.
Because of this mismatch between VoteManager and QuorumManager, any representative with positive vote weight (> 0, including a 1-micro-XE self-delegated account under RepModeOpen or any minor representative under RepModeAllowlist) can broadcast a CONVERGE vote for a victim's unresolved position (victimAccount, victimPrev) whose BlockHash points to an already-finalized block from a different chain/position B_foreign with B_foreign.Hash < B_victim.Hash (for example, genesis.Hash or any low-hash block on the attacker's own chain).
Honest representatives accept the cross-position vote, adopt B_foreign.Hash as their lowest-hash eligible candidate (lowestHash(eligible)), reach >=67% converge weight on B_foreign.Hash, and after the 3-second lockStabilityWindow permanently lock (victimAccount, victimPrev) -> B_foreign.Hash in the write-once FinalVoteStore (PutFinalVoteIfAbsent) and VoteStore. When QuorumManager.finalTally subsequently tallies (victimAccount, victimPrev), it ignores all FINAL votes for B_foreign.Hash because B_foreign.Account != victimAccount || B_foreign.Previous != victimPrev. Because FinalVoteStore and VoteStore are write-once for FINAL votes per (account, prev), honest representatives can never emit a FINAL vote for B_victim.Hash, permanently and irreversibly freezing victimAccount's FinalHeight across node restarts.
Root Cause
-
ValidateVoteandisConflictNotFound(core/vote.go:167-261) do not check block position:ValidateVote(v)verifies the signature, checksvm.ledger.GetVoteWeight(v.RepAccount()) > 0, and checks the timestamp window, but never checks whetherb := vm.ledger.GetBlockOrStaged(v.BlockHash)(when present) satisfiesb.Account == v.ConflictAccount && b.Previous == v.ConflictPrev. -
gatherCandidates,noteHeldCandidatesLocked,castVoteLocked,convergeWeights, andemitFinalLocked(core/finalization.go) only checkGetBlockOrStaged(h) != nil:gatherCandidates(account, prev, seed...)(core/finalization.go:354-376) collects everyv.BlockHashfromvm.store.GetVotesByConflict(account, prev)without checking the block's(Account, Previous).noteHeldCandidatesLocked(account, prev, candidates)(core/finalization.go:197-216) checks onlyif vm.ledger.GetBlockOrStaged(h) == nil { continue }, allowing votes referencing arbitrary existing blocks on the lattice to resetvm.lastNewCandidateNanos[key]and stall the 3-secondlockStabilityWindow.castVoteLocked(account, prev, seed...)(core/finalization.go:128-146) admits any candidatehwithvm.ledger.GetBlockOrStaged(h) != nilintoeligible, pickspref := lowestHash(eligible), and checksvm.ledger.depsFinalized(prefBlock). For any already-finalized foreign blockB_foreign(such asgenesisor a finalized block on the attacker's chain),GetBlockOrStaged(B_foreign.Hash)is non-nil anddepsFinalized(B_foreign)istrue.- When
B_foreign.Hash < B_victim.Hash, every honest representative switches its ownCONVERGEvote for(victimAccount, victimPrev)toB_foreign.Hashwith its full delegated weight. maybeLockLocked->emitFinalLocked(victimAccount, victimPrev, B_foreign.Hash)(core/finalization.go:265-306) then callsvm.ledger.finalVoteStore.PutFinalVoteIfAbsent(victimAccount, victimPrev, B_foreign.Hash)and stores aFinal: truevote inVoteStore. Both stores refuse to overwrite a locked/final vote for(victimAccount, victimPrev).
-
Cross-conflict
LoserHashespollution inQuorumManager.finalTally(core/quorum.go:111-123): InfinalTally(account, previous),candidateSet[v.BlockHash] = trueis executed on line 112 before theif b == nil || b.Account != account || b.Previous != previouscheck on line 121. If a voter submits a cross-position vote on(attackerAccount, attackerPrev)naming a victim's staged blockB_victimStaged.Hash, resolving(attackerAccount, attackerPrev)placesB_victimStaged.Hashintoresult.LoserHashes, causingcleanupResolvedConflict(core/quorum.go:399-405) to markB_victimStaged.HashasStatusRejectedinQuorumStoreand delete it viaDeleteStagedBlock.
Impact
- Permanent, irreversible account finality freeze (DoS / funds lock): Any voter with
>= 1micro-XE of weight can permanently freeze finality (FinalHeight) for any account block whose hash is lexicographically greater than any finalized block hash on the lattice (genesis.Hashalone is038d0d04..., which is smaller than ~98.6% of SHA-256 block hashes, and an attacker can also grind a single low-hash block on their own chain). Once honest representatives writeB_foreign.HashintoFinalVoteStore(prefixFinalVotein BadgerDB), the lock persists across restarts and the victim account can never finalize that height or spend subsequent balances. - Stability window stalling: Even using foreign blocks with higher hashes, an attacker can repeatedly reset
lastNewCandidateNanos[key]innoteHeldCandidatesLockedby referencing distinct blocks already on the lattice. - Cross-conflict staged block deletion and
StatusRejectedpoisoning: A cross-position vote on an attacker-controlled slot causescleanupResolvedConflictto delete a victim's staged block and mark its hashStatusRejected.
Proposed Fix
- Add
blockMatchesPosition(b *Block, account, prev string) booland(l *Ledger) blockForPosition(account, prev, hash string) *Blockincore/finalization.go. - In
ValidateVoteandisConflictNotFound(core/vote.go), reject any vote whosev.BlockHashresolves viaGetBlockOrStagedto a block that does not match(v.ConflictAccount, v.ConflictPrev). - In
gatherCandidates,noteHeldCandidatesLocked,castVoteLocked,convergeWeights, andemitFinalLocked(core/finalization.go), require resolved candidate blocks to match(account, prev)viablockMatchesPosition/blockForPosition(including beforePutFinalVoteIfAbsentinemitFinalLocked). - In
QuorumManager.finalTally(core/quorum.go), checkb != nil && !blockMatchesPosition(b, account, previous)before insertingv.BlockHashintocandidateSet.
Payout wallet (Base / XE): 0x45Ecf534fD00bb3179D34E6a3FDdE084cBfBc9Fb
Thread
Claimed Tier: High (10,000 XE) / Severe (25,000 XE). Updated GitHub issue #289 title with [HIGH] prefix. Companion fix PR with regression tests: https://github.com/xeprotocol/xe/pull/290 — Bound XE Payout Address: 975f2f37dda1568c766729d9f85ad01e37f0c71d469af19d0b2aaaef861d9574
Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-1088 and says what differs; it is read like any other.