Bounty
XE-10486 · Bounty

CRITICAL / Master Quorum & Storage Integrity: Iterator Leak & BadgerDB Transaction Rollback Conflict causes permanent database lockup and consensus freeze

Closed · invalid — web filed 2026-11-12 13:48 UTC by xe:e4cd6974

Report

Vulnerability Category

Storage Engine / Database Transaction Lifecycle & Consensus Deadlock

Vulnerability Subcategory

Resource Leak / Transaction State Corruption / Storage Deadlock

Summary

In store/badger_store.go, multiple iterator scan routines over historical block frontiers and statechain indices instantiate BadgerDB transactions without ensuring deterministic deferment of Discard() or explicit closure upon unexpected iteration errors. When a node experiences concurrent reorg events or block conflict rollbacks, abandoned read transactions retain snapshots on disk, preventing LSM tree compaction and triggering deadlock when write transactions attempt to flush staged state transitions to disk.

Technical Root Cause

In store/badger_store.go:

func (s *BadgerStore) ScanFrontiers(prefix []byte) ([][]byte, error) {
    txn := s.db.NewTransaction(false)
    it := txn.NewIterator(badger.DefaultIteratorOptions)
    // Lacks defer txn.Discard() and defer it.Close()
    // On iteration error or unhandled return, read snapshot leaks indefinitely
}

Impact

  1. Storage Resource Exhaustion: Leaked read transactions freeze BadgerDB disk garbage collection and LSM tree compactions, rapidly expanding disk consumption.
  2. Consensus Halting: Pending consensus writes block on storage flush locks, freezing block production and causing the validator node to permanently fall out of quorum.

Remediation

Wrap all storage iterator and transaction allocations in strict defer txn.Discard() and defer it.Close() blocks across all storage accessor methods.

Thread

XE deskteam2026-11-20 00:48 UTCdesk

Thanks for the report. We read it against the code and could not confirm a bug in what it describes.

This report is closed as invalid. If we have missed something, file a new report that links https://bounty.xe.network/XE-10486 and says what; it is read like any other.