Bounty
XE-13226 · Bounty

net,core: PullVotes/PullBlocks lack coordinate and hash pre-checks and ReceiveVote resets revoteBackoff on duplicate non-final votes

Closed · duplicate — xe#350 filed 2026-11-11 04:57 UTC by Khanhtnq

Report

Summary

Peer-pulled conflict votes and block bodies in net/votesync.go and net/blocksync.go pass unverified or duplicate records into ingest, and core.VoteManager.receiveVoteInner treats replayed non-final votes as state changes:

  1. net.PullVotes (net/votesync.go:40-70) accepts cross-position votes and repeats duplicate ingests across peers:

    • PullVotes requests votes for (account, previous) but never checks v.ConflictAccount == account && v.ConflictPrev == previous before calling ingest(v). A peer responding to a pull for conflict (A, P1) can return votes belonging to unrelated conflicts (B, P2).
    • PullVotes has no ctx.Err() check between peer requests and no deduplication across peers, re-verifying Ed25519 signatures for identical (RepPubKey, BlockHash, Final) votes returned by every connected peer (while any dedup set must only record a vote after ingest(v) succeeds so a peer serving an invalid signature cannot suppress a subsequent honest peer's valid vote).
    • SetupVoteSync (net/votesync.go:29-38) also invokes provide even when req.Account == "".
  2. net.PullBlocks (net/blocksync.go:50-96) does not cap response scan length or verify core.HashBlock(b) == b.Hash before ingest(b):

    • PullBlocks requests at most MaxBlockRequestHashes (64) hashes, but scans an unbounded resp.Blocks slice and does not check ctx.Err() between peers.
    • PullBlocks checks want[b.Hash] using the peer-supplied b.Hash field without computing core.HashBlock(b). A response carrying a modified body under a requested b.Hash reaches ingest(b) directly instead of being rejected at the response boundary.
  3. core.VoteManager.receiveVoteInner (core/vote.go:134-165) overwrites identical non-final votes and resets revoteBackoff:

    • ReceiveVote / receiveVoteInner (core/vote.go:107-165) returns early when existing != nil && existing.Final, but when existing != nil && !existing.Final && !v.Final && existing.BlockHash == v.BlockHash, it rewrites PutVote(v), deletes vm.lastRevoteNanos[account+"|"+prev] (allowing any peer replaying an existing converge vote to clear the local representative's 15s revoteBackoff and trigger immediate Sync() + vote re-emission in castVoteLocked), and re-triggers quorumMgr.OnVote(v).

Locations (origin/master @ 89a542ea)

  • net/votesync.go:29-70
  • net/blocksync.go:50-96
  • core/vote.go:107-165

Thread

Joseph Denneteam2026-11-20 00:05 UTCgithub

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-13226 and says what differs; it is read like any other.