<!-- XE-9790 · Storage & Consensus Leak: dropConflictIfOrphaned purges votes and conflict record but permanently leaks staged block bodies in store · testnet -->
*Markdown view of <https://bounty.xe.network/XE-9790>. The page is the record; this is the same page for reading.*

XE-9790 · Bounty

# Storage \& Consensus Leak: dropConflictIfOrphaned purges votes and conflict record but permanently leaks staged block bodies in store

Closed · duplicate
—
web
filed 2026-11-12 07:14 UTC
by xe:e4cd6974

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   Consensus

Duplicate of
:   [XE-13262](https://bounty.xe.network/XE-13262) triaging

Tracked
:   —

Updated
:   2026-11-20 00:33 UTC

Told
:   2026-11-20 00:33 UTC

### Patches

None linked.

### History

- [552705](https://bounty.xe.network/log/552705) 2026-11-20 00:33 UTC proposal.adopted
- [552704](https://bounty.xe.network/log/552704) 2026-11-20 00:33 UTC reply.sent
- [552703](https://bounty.xe.network/log/552703) 2026-11-20 00:33 UTC ticket.status new → closed
- [552135](https://bounty.xe.network/log/552135) 2026-11-20 00:33 UTC proposal.adopted
- [552134](https://bounty.xe.network/log/552134) 2026-11-20 00:33 UTC ticket.facts area
- [552133](https://bounty.xe.network/log/552133) 2026-11-20 00:33 UTC proposal.adopted
- [552132](https://bounty.xe.network/log/552132) 2026-11-20 00:33 UTC ticket.facts
- [552131](https://bounty.xe.network/log/552131) 2026-11-20 00:33 UTC proposal.adopted
- [552130](https://bounty.xe.network/log/552130) 2026-11-20 00:33 UTC ticket.facts
- [550720](https://bounty.xe.network/log/550720) 2026-11-20 00:30 UTC note.added
- [550708](https://bounty.xe.network/log/550708) 2026-11-20 00:30 UTC proposal.created
- [550707](https://bounty.xe.network/log/550707) 2026-11-20 00:30 UTC proposal.created

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

### Report

## Vulnerability Summary

In `core/quorum.go:451-468`, `dropConflictIfOrphaned(c *Conflict) bool` detects when a conflict election's chain position has been rolled back or superseded, and purges the conflict record and its associated votes from disk:

```
func (qm *QuorumManager) dropConflictIfOrphaned(c *Conflict) bool {
	entry := qm.ledger.acquireAccountLock(c.AccountAddress)
	defer qm.ledger.releaseAccountLock(c.AccountAddress, entry)
	if !qm.conflictOrphanedByRollback(c) {
		return false
	}
	log.Printf("quorum: dropping orphaned conflict %s|%s — its chain position was rolled back (a candidate is rejected and the parent is no longer on the canonical chain)",
		shortHash(c.AccountAddress), shortHash(c.PreviousHash))
	if err := qm.store.DeleteVotesForConflict(c.AccountAddress, c.PreviousHash); err != nil {
		log.Printf("quorum: DeleteVotesForConflict (orphan drop) for %s|%s: %v",
			shortHash(c.AccountAddress), shortHash(c.PreviousHash), err)
	}
	RemoveConflict(qm.conflictMgr, c.AccountAddress, c.PreviousHash)
	return true
}
```

Notice that while `cleanupResolvedConflict` (`core/quorum.go:394-406`) explicitly loops through `result.WinnerHash` and all `result.LoserHashes` calling `qm.conflictMgr.DeleteStagedBlock(hash)`, **`dropConflictIfOrphaned` completely omits deleting the staged blocks (`c.BlockHashes`)**!

---

## Vulnerable Code Locations

- `core/quorum.go:451-468`:
  `dropConflictIfOrphaned` calls `DeleteVotesForConflict` and `RemoveConflict(qm.conflictMgr, ...)`, but never invokes `DeleteStagedBlock(hash)` for the candidates in `c.BlockHashes`.

---

## Attack \& Failure Scenario

1. During active consensus elections or forks, candidate block bodies competing in the conflict are saved to persistent disk storage under `prefixStaged` (`0x09`) via `cs.SaveStagedBlock(b)` (`core/ledger.go:860`).
2. If the conflict becomes orphaned due to a chain rollback or reorganization on the parent account:
   - `dropConflictIfOrphaned` triggers during the periodic evaluation cycle (`qm.evaluateConflicts`).
   - It deletes the conflict votes from Badger store (`DeleteVotesForConflict`) and deletes the conflict metadata entry (`RemoveConflict`).
3. **Permanent Storage Leak \& Ghost Block Resurrection**:
   - Because `DeleteStagedBlock` is never called for any hash in `c.BlockHashes`, all full candidate block bodies remain permanently written on disk in BadgerDB under `prefixStaged`.
   - Over time, as nodes process conflicting network forks and reorgs, orphaned staged blocks accumulate indefinitely with no Garbage Collection (GC) or deletion path.
   - Furthermore, because `GetBlockOrStaged` (`core/ledger.go:1072`) searches staged blocks when looking up blocks, these orphaned blocks can be resurrected as valid transaction sources or dependency parents for future invalid transactions, poisoning transaction dependency tracking.

---

## Impact

1. **Unbounded Persistent Disk Exhaustion**:
   Nodes leak full block payloads for every orphaned conflict candidate across the network life cycle. An attacker broadcasting discarded conflicting blocks can permanently bloat validator disk storage.
2. **Ghost Dependency Poisoning**:
   Orphaned staged blocks remain retrievable via `GetBlockOrStaged`, allowing transactions to bind against phantom unfinalized blocks whose conflict records were long discarded.

---

## Remediation

In `core/quorum.go`, update `dropConflictIfOrphaned` to delete all staged block payloads associated with the orphaned conflict:

```
func (qm *QuorumManager) dropConflictIfOrphaned(c *Conflict) bool {
	entry := qm.ledger.acquireAccountLock(c.AccountAddress)
	defer qm.ledger.releaseAccountLock(c.AccountAddress, entry)
	if !qm.conflictOrphanedByRollback(c) {
		return false
	}
	log.Printf("quorum: dropping orphaned conflict %s|%s — its chain position was rolled back",
		shortHash(c.AccountAddress), shortHash(c.PreviousHash))
	if err := qm.store.DeleteVotesForConflict(c.AccountAddress, c.PreviousHash); err != nil {
		log.Printf("quorum: DeleteVotesForConflict (orphan drop) for %s|%s: %v",
			shortHash(c.AccountAddress), shortHash(c.PreviousHash), err)
	}
	for _, h := range c.BlockHashes {
		if err := qm.conflictMgr.DeleteStagedBlock(h); err != nil {
			log.Printf("quorum: DeleteStagedBlock (orphan drop) for %s: %v", shortHash(h), err)
		}
	}
	RemoveConflict(qm.conflictMgr, c.AccountAddress, c.PreviousHash)
	return true
}
```

### Thread

**Joseph Denne**team2026-11-20 00:33 UTCdesk

Thanks. This is the same finding as https://bounty.xe.network/XE-13262, 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-9790 and says what differs; it is read like any other.
