net,core: PullVotes/PullBlocks lack coordinate and hash pre-checks and ReceiveVote resets revoteBackoff on duplicate non-final votes
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:
-
net.PullVotes(net/votesync.go:40-70) accepts cross-position votes and repeats duplicate ingests across peers:PullVotesrequests votes for(account, previous)but never checksv.ConflictAccount == account && v.ConflictPrev == previousbefore callingingest(v). A peer responding to a pull for conflict(A, P1)can return votes belonging to unrelated conflicts(B, P2).PullVoteshas noctx.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 afteringest(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 invokesprovideeven whenreq.Account == "".
-
net.PullBlocks(net/blocksync.go:50-96) does not cap response scan length or verifycore.HashBlock(b) == b.Hashbeforeingest(b):PullBlocksrequests at mostMaxBlockRequestHashes(64) hashes, but scans an unboundedresp.Blocksslice and does not checkctx.Err()between peers.PullBlockscheckswant[b.Hash]using the peer-suppliedb.Hashfield without computingcore.HashBlock(b). A response carrying a modified body under a requestedb.Hashreachesingest(b)directly instead of being rejected at the response boundary.
-
core.VoteManager.receiveVoteInner(core/vote.go:134-165) overwrites identical non-final votes and resetsrevoteBackoff:ReceiveVote/receiveVoteInner(core/vote.go:107-165) returns early whenexisting != nil && existing.Final, but whenexisting != nil && !existing.Final && !v.Final && existing.BlockHash == v.BlockHash, it rewritesPutVote(v), deletesvm.lastRevoteNanos[account+"|"+prev](allowing any peer replaying an existing converge vote to clear the local representative's 15srevoteBackoffand trigger immediateSync()+ vote re-emission incastVoteLocked), and re-triggersquorumMgr.OnVote(v).
Locations (origin/master @ 89a542ea)
net/votesync.go:29-70net/blocksync.go:50-96core/vote.go:107-165
Thread
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.