{"id":"XE-13226","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"350","source_url":"https://github.com/xeprotocol/xe/issues/350","reporter_id":2,"title":"net,core: PullVotes/PullBlocks lack coordinate and hash pre-checks and ReceiveVote resets revoteBackoff on duplicate non-final votes","area":"p2p-sync","claimed_tier":null,"assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:00.821022+00:00","updated_at":"2026-11-20T00:07:01.691196+00:00","source_created_at":"2026-11-11T04:57:06+00:00","told_at":"2026-11-20T00:05:05+00:00","status_changed_at":"2026-11-20T00:04:39.229393+00:00","url":"https://bounty.xe.network/XE-13226","body":"### Summary\n\nPeer-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:\n\n1. **`net.PullVotes` (`net/votesync.go:40-70`) accepts cross-position votes and repeats duplicate ingests across peers**:\n   - `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)`.\n   - `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).\n   - `SetupVoteSync` (`net/votesync.go:29-38`) also invokes `provide` even when `req.Account == \"\"`.\n\n2. **`net.PullBlocks` (`net/blocksync.go:50-96`) does not cap response scan length or verify `core.HashBlock(b) == b.Hash` before `ingest(b)`**:\n   - `PullBlocks` requests at most `MaxBlockRequestHashes` (`64`) hashes, but scans an unbounded `resp.Blocks` slice and does not check `ctx.Err()` between peers.\n   - `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.\n\n3. **`core.VoteManager.receiveVoteInner` (`core/vote.go:134-165`) overwrites identical non-final votes and resets `revoteBackoff`**:\n   - `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)`.\n\n### Locations (`origin/master` @ `89a542ea`)\n\n- `net/votesync.go:29-70`\n- `net/blocksync.go:50-96`\n- `core/vote.go:107-165`","patch_refs":[{"id":541,"repo":"xeprotocol/xe","kind":"pr","ref":"351","title":"fix(net,core): verify pulled vote coordinates and block hashes before ingest","url":"https://github.com/xeprotocol/xe/pull/351","note":"","state":"open","author":"Khanhtnq","added_by":"desk","created_at":"2026-11-14T20:42:19.677539+00:00"}],"thread":[{"id":12813,"source":"github","source_ref":"7025802592","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-13226 and says what differs; it is read like any other.","created_at":"2026-11-20T00:05:05+00:00"}]}