<!-- XE-0435 · [Consensus] Conflict cleanup treats every voted hash as a loser: one vote from any weighted representative deletes another account's staged block and freezes the account (High) · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0435>. The page is the record; this is the same page for reading.*

XE-0435 · Bounty

# \[Consensus\] Conflict cleanup treats every voted hash as a loser: one vote from any weighted representative deletes another account's staged block and freezes the account (High)

Closed · duplicate
—claimed High
web
filed 2026-11-04 09:03 UTC
by xe:8dad6341

Verdict
:   Duplicate

Tier
:   —

Claimed
:   High

Area
:   Consensus

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-14 22:52 UTC

Told
:   2026-11-14 22:52 UTC

### Patches

None linked.

### History

- [209820](https://bounty.xe.network/log/209820) 2026-11-14 22:52 UTC reply.sent
- [44484](https://bounty.xe.network/log/44484) 2026-11-08 20:32 UTC proposal.adopted
- [44483](https://bounty.xe.network/log/44483) 2026-11-08 20:32 UTC ticket.status new → closed
- [26009](https://bounty.xe.network/log/26009) 2026-11-08 10:11 UTC proposal.adopted
- [26008](https://bounty.xe.network/log/26008) 2026-11-08 10:11 UTC proposal.adopted
- [26007](https://bounty.xe.network/log/26007) 2026-11-08 10:11 UTC ticket.facts
- [26006](https://bounty.xe.network/log/26006) 2026-11-08 10:11 UTC proposal.adopted
- [26005](https://bounty.xe.network/log/26005) 2026-11-08 10:11 UTC ticket.facts
- [26004](https://bounty.xe.network/log/26004) 2026-11-08 10:11 UTC proposal.adopted
- [24539](https://bounty.xe.network/log/24539) 2026-11-08 09:46 UTC proposal.created
- [24538](https://bounty.xe.network/log/24538) 2026-11-08 09:46 UTC proposal.created
- [24537](https://bounty.xe.network/log/24537) 2026-11-08 09:46 UTC proposal.created

[Full history](https://bounty.xe.network/log?ref=XE-0435) · [JSON](https://bounty.xe.network/v1/tickets/XE-0435) · [markdown](https://bounty.xe.network/XE-0435.md)

### Report

# \[Consensus\] Conflict cleanup treats every voted hash as a loser: one vote from any weighted representative deletes another account's staged block and freezes the account (High)

**Repo pin:** `xeprotocol/xe` master @ `02e9641` (2026-11-03), network `testnet-0005`
**Component:** `core/quorum.go` (`finalTally`, `buildResultFrom`, `cleanupResolvedConflict`)
**CWE:** CWE-863 (Incorrect Authorization) — a vote authorises cleanup of hashes it never named
**CVSS 3.1:** 8.2 High — `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L`
**Suggested tier:** High (10,000 XE) — remotely triggerable, one gossip message, permanent
targeted fund lock.

## Summary

`finalTally` inserts **every** stored vote's `BlockHash` into `candidateSet` *before* the
retrievability / account / previous filter runs. `buildResultFrom` then defines losers as
`candidateSet - winner`, and `cleanupResolvedConflict` calls `rejectBlocks(losers)` (which sets
`StatusRejected`) and `DeleteStagedBlock(loser)` for each. Staged blocks are keyed by hash alone
in the store, so the delete hits **any account's** staged body.

A vote's signature covers `{rep, block_hash, conflict_account, conflict_prev, timestamp, final}` —
`ValidateVote` never checks that `block_hash` belongs to `(conflict_account, conflict_prev)`. So a
representative with any positive vote weight can sign one vote whose `BlockHash` is a victim's
staged block on a different account or position, place it at a conflict position that later
resolves, and the victim's staged block is destroyed as a "loser" of a conflict it was never part
of.

## Affected code

- `core/quorum.go:111-112` — `candidateSet[v.BlockHash] = true` runs **before** the
  `GetBlockOrStaged` / `b.Account != account` / `b.Previous != previous` filter at lines 120-123.
- `core/quorum.go:221-234` — `buildResultFrom`: `losers = candidateSet - winner`.
- `core/quorum.go:399-406` — `cleanupResolvedConflict`: `rejectBlocks(losers)` \+
  `DeleteStagedBlock(loser)` for every loser.

## Proof of concept

Drop-in tests, run against a fresh clone at the pinned commit:

```
git clone https://github.com/xeprotocol/xe.git && cd xe && git checkout 02e9641
cp zz_internal_test.go zz_pollution_test.go core/
go test ./core/ -run TestCrossPositionLoserPollution -v
```

Output (executed 2026-11-04):

```
=== RUN   TestCrossPositionLoserPollution
2026/11/04 08:43:54 Genesis block applied: 42000000000000 XE to aa0f671c8610...
    zz_pollution_test.go:113: setup ok: v2 staged=89b34762fbb3
    zz_pollution_test.go:128: polluting vote for 89b34762fbb3 at (aa0f671c,bdb6e0f9) accepted
    zz_pollution_test.go:139: after resolution: staged(v2)=false  status(v2)=2 (2=Rejected)
    zz_pollution_test.go:147: victim conflict still open with candidates [7245119dbbbd 89b34762fbb3] — v2 can never win now
--- PASS: TestCrossPositionLoserPollution (0.02s)
```

The polluting vote names the victim's staged block hash at a different position; the vote is
accepted; when the conflict at the attacker's position resolves, the victim's staged body is
deleted and marked `StatusRejected` while the victim's own conflict record stays open holding a
bodyless candidate.

## Impact

- **Permanent account freeze (fund lock).** `Ledger.addBlock` rejects every new block for an
  account with an unresolved conflict record (`core/ledger.go:815-818`), and `finalTally` drops
  votes whose block is not retrievable (`quorum.go:120-123`) — so the victim's candidate can never
  win again. The account's funds are unspendable until the conflict is resolved, which it never
  can be.
- **Any staged block on the network is destroyable** by any staked representative with a single
  gossip message; no authentication beyond a delegated key, no PoW, no funds.
- Secondary: marking a hash `StatusRejected` also makes `conflictOrphanedByRollback`
  (`quorum.go:515-524`) classify the victim's conflict as orphaned, silently dropping it and
  deleting its votes.

## Duplication check

Not a duplicate of: XE-0161 (unbounded vote-store growth for nonexistent conflicts — storage,
not cleanup), XE-0045 (zero-weight vote admission — admission policy), XE-0052 (staged blocks
that fail full admission), XE-0042 (pickWinner substituting a non-quorum winner). None of them
touch `candidateSet`/`LoserHashes` pollution or the cross-account `DeleteStagedBlock`.

## Suggested fix

Move `candidateSet[v.BlockHash] = true` **after** the retrievability \+ account \+ previous filter
(only hashes that actually belong to this conflict position may enter the candidate set), and
have `cleanupResolvedConflict` re-verify each loser's account/previous before deleting or
rejecting it.

### Thread

**xe:8dad6341**2026-11-04 09:09 UTCweb

Clarification on scope, so this is not triaged against the wrong neighbour:

This report is **not** XE-0402 ("Staged-block store is unbounded and leaks on non-resolved
exit"). XE-0402 is about the staged-block store growing without bound and leaking memory on
non-resolved exit paths — a resource/volume defect in the store itself.

This finding is the opposite direction: the store is *written correctly*, but
`cleanupResolvedConflict` (core/quorum.go:399-406) **deletes** a staged block that belongs to a
different account or a different conflict position, because `finalTally` inserts every voted
`BlockHash` into `candidateSet` (core/quorum.go:111-112) before the account/previous filter at
lines 120-123, and `buildResultFrom` (quorum.go:221-234) defines losers as
`candidateSet - winner`. One signed vote from any weighted representative whose `BlockHash` names
a victim's staged block is enough; the victim's candidate is then deleted and marked
`StatusRejected`, its conflict can never resolve, and `Ledger.addBlock` freezes the account
(core/ledger.go:815-818). The drop-in test in the attachments demonstrates exactly that:
after an unrelated conflict resolves, `GetStagedBlock(victim) = nil` and
`GetBlockStatus(victim) = StatusRejected`.

Also not XE-0052 (staged validation weaker than full admission) or XE-0042 (pickWinner
substituting a non-quorum winner): neither touches candidateSet/LoserHashes pollution or the
cross-account DeleteStagedBlock.

**xe:8dad6341**2026-11-04 09:59 UTCweb

Clarification on scope, so this is not triaged against the wrong neighbour:

This report is **not** XE-0402 ("Staged-block store is unbounded and leaks on non-resolved
exit"). XE-0402 is about the staged-block store growing without bound and leaking memory on
non-resolved exit paths — a resource/volume defect in the store itself.

This finding is the opposite direction: the store is *written correctly*, but
`cleanupResolvedConflict` (core/quorum.go:399-406) **deletes** a staged block that belongs to a
different account or a different conflict position, because `finalTally` inserts every voted
`BlockHash` into `candidateSet` (core/quorum.go:111-112) before the account/previous filter at
lines 120-123, and `buildResultFrom` (quorum.go:221-234) defines losers as
`candidateSet - winner`. One signed vote from any weighted representative whose `BlockHash` names
a victim's staged block is enough; the victim's candidate is then deleted and marked
`StatusRejected`, its conflict can never resolve, and `Ledger.addBlock` freezes the account
(core/ledger.go:815-818). The drop-in test in the attachments demonstrates exactly that:
after an unrelated conflict resolves, `GetStagedBlock(victim) = nil` and
`GetBlockStatus(victim) = StatusRejected`.

Also not XE-0052 (staged validation weaker than full admission) or XE-0042 (pickWinner
substituting a non-quorum winner): neither touches candidateSet/LoserHashes pollution or the
cross-account DeleteStagedBlock.

---

CVSS correction: vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L computes to 7.1, not 8.2.
ISC\=1-(1-0.56)(1-0.22)\=0.657; Impact\=6.42x0.657\=4.217;
Exploitability\=8.22x0.85x0.77x0.62x0.85\=2.835; raw\=7.052; roundup\=7.1 (High band).
Submitted score corrected.

**XE desk**team2026-11-14 22:52 UTCdesk

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