{"id":"XE-13378","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"532","source_url":"https://github.com/xeprotocol/xe/issues/532","reporter_id":2252,"title":"Votes for nonexistent conflicts are accepted and stored forever — phantom votes accumulate unboundedly","area":"consensus","claimed_tier":"minor","assessed_tier":null,"verdict":"duplicate","duplicate_of":"XE-0109","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:13.550667+00:00","updated_at":"2026-11-20T00:52:03.698917+00:00","source_created_at":"2026-11-13T03:23:41+00:00","told_at":"2026-11-20T00:50:05.973839+00:00","status_changed_at":"2026-11-20T00:50:05.958295+00:00","url":"https://bounty.xe.network/XE-13378","body":"**Suggested tier:** Low\n\n**XE address (reward destination):** 9b663fdac108be34a3b715ef78a9f9bd878af6ef8142f388c6514918e6852dd7\n\n## Summary\n\n`core/vote.go: ValidateVote` and `core/quorum.go: receiveVoteInner` never check that the conflict a vote references actually exists. A vote for a nonexistent (account, prev) pair is accepted and stored in the vote store forever — no expiry, no eviction, no cleanup. The vote store grows unboundedly: 200 phantom votes were proven stored in the PoC, and there is no upper bound on how many can be accumulated.\n\n## Impact\n\nUnbounded storage growth on every node: an attacker can flood the network with votes for nonexistent conflicts, and every node stores them forever. The votes never affect consensus (they reference no real conflict, so they are never tallied), so the impact is storage / memory exhaustion only — hence Low. No funds, no finality, no account freeze.\n\n## Steps to reproduce\n\nUnit test against the real node code (`github.com/xeprotocol/xe`, testnet-0005, commit `89a542e`):\n\n```\ngit clone https://github.com/xeprotocol/xe\ncd xe\ncp trackb_quorum_test.go core/\ncp trackb_attestation_test.go core/\ngo test ./core -run TestTrackB_PhantomVotes -v -count=1\n```\n\nNote: `trackb_quorum_test.go` / `trackb_attestation_test.go` are NOT in the public repository — the PoC test files are attached to this issue; without them, the XE team cannot run this reproduction.\n\n`TestTrackB_PhantomVotes`: 200 votes for nonexistent conflicts (random account/prev pairs, valid rep signatures) are fed through the real vote path.\n\n**Expected:** votes for nonexistent conflicts are rejected.\n**Actual (reproduced 2026-11-13):** all 200 votes are accepted and stored; the vote store holds 200 phantom entries with no expiry.\n```\nCONFIRMED: 200 phantom votes for nonexistent conflicts accepted and stored forever (no existence check, no expiry)\n```\n\n## Root cause\n\n`core/vote.go: ValidateVote` does not check that the referenced conflict exists in the conflict store; `core/quorum.go: receiveVoteInner` stores the vote unconditionally. There is no TTL, cap, or sweep for phantom votes (unlike `sweepStaleConflicts`, which only handles real conflicts).\n\n## Suggested fix\n\nReject votes whose (account, prev) has no matching conflict record, and/or add a TTL + cap to the vote store with a periodic sweep of votes that reference no live conflict.\n\n## Controls verified (same PoC file, all PASS)\n\n- Duplicate / replayed / equivocating votes: vote store keyed by (account, prev, rep), so a rep flipping a non-final vote overwrites (1 stored vote), an exact replay leaves 1 entry, and a final vote LOCKS (equivocating final vote dropped). 45.8% does not finalize; 84% finalizes (`TestTrackB_DuplicateAndEquivocatingVotes`).\n- Vote timestamp window: 6-min-old and 6-min-future votes rejected; fresh votes accepted (5-minute window).\n- Finalize-then-conflict: after S1 finalized by 84% final votes, a new conflicting block is rejected (\"block conflicts with finalized block … — rejected\"); `core/rollback.go` refuses to roll back finalized blocks. Happy path also passes: staged winner S2 swaps in, loser S1 demoted off-chain, S2 finalized at height 2, conflict record cleaned up.\n- Attestations: duplicates count once, non-timekeeper ignored, forged attestation rejected, ±10 min skew enforced, threshold enforced after filtering.\n\n[trackb_quorum.txt](https://github.com/user-attachments/files/34781709/trackb_quorum.txt)\n[trackb_attestation.txt](https://github.com/user-attachments/files/34781710/trackb_attestation.txt)","patch_refs":[{"id":571,"repo":"xeprotocol/xe","kind":"pr","ref":"534","title":"fix(core): validate conflict existence and reject phantom votes (#532)","url":"https://github.com/xeprotocol/xe/pull/534","note":"","state":"open","author":"arturbarszcz78","added_by":"desk","created_at":"2026-11-14T20:42:20.242165+00:00"}],"thread":[{"id":13543,"source":"github","source_ref":"7026824115","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as https://bounty.xe.network/XE-0109, 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-13378 and says what differs; it is read like any other.","created_at":"2026-11-20T00:51:00+00:00"}]}