Bounty
XE-9728 · Bounty

Staged Block Validation Bypass: ValidateStagedBlock omits lease state, provider authorization, and emission verification on BlockLeaseSettle

Closed · duplicate — web filed 2026-11-12 06:44 UTC by xe:e4cd6974

Report

Vulnerability Summary

In core/ledger.go:2732-2870, ValidateStagedBlock(b *Block, parentBalance uint64) error performs consensus validation on candidate blocks competing in BFT quorum elections before staging or promotion to the canonical ledger.

When BlockLeaseSettle is validated during normal block ingestion (validateAndAddLeaseSettle, core/ledger.go:2117-2184), the node strictly verifies:

  1. b.Asset == "XE" (core/ledger.go:2118-2119).
  2. lease.Provider == b.Account (core/ledger.go:2134-2136).
  3. !lease.Settled and lease.State == LeaseAccepted (core/ledger.go:2131-2144).
  4. settleTime >= expiry and settleTime <= expiry+LeaseSettleGrace via timekeeper attestations (core/ledger.go:2158-2172).
  5. expectedXE, err := LeaseTotalEmission(lease); if b.Amount != expectedXE { return fmt.Errorf("lease_settle: ...") } (core/ledger.go:2174-2178).

However, in ValidateStagedBlock (core/ledger.go:2793-2808):

	case BlockLeaseSettle:
		pending, err := l.store.GetPendingSend(b.Source)
		if err != nil {
			return fmt.Errorf("staged lease_settle: GetPendingSend: %w", err)
		}
		if pending == nil {
			return fmt.Errorf("staged lease_settle: no pending escrow for lease")
		}
		expectedBal := parentBalance + b.Amount
		if expectedBal < parentBalance {
			return fmt.Errorf("staged lease_settle: balance would overflow uint64")
		}
		if b.Balance != expectedBal {
			return fmt.Errorf("staged lease_settle: balance mismatch: expected %d, got %d", expectedBal, b.Balance)
		}

Notice that ValidateStagedBlock for BlockLeaseSettle:

  1. Never checks b.Asset == "XE": It allows arbitrary asset tags (e.g. minting XUSD).
  2. Never loads the lease record (l.store.GetLease): It checks l.store.GetPendingSend(b.Source), which only verifies that an escrow exists!
  3. Never verifies b.Amount == expectedXE: An attacker can set b.Amount to any arbitrary uint64 value (e.g. 100,000,000 XE) as long as b.Balance == parentBalance + b.Amount!
  4. Never verifies lease.Provider == b.Account: Any non-provider account can settle the lease!
  5. Never verifies lease expiration or attestations: An unexpired or unaccepted lease can be settled instantly!

Vulnerable Code Locations

  • core/ledger.go:2793-2808: ValidateStagedBlock for BlockLeaseSettle verifies only that b.Source exists in PendingSend and that b.Balance == parentBalance + b.Amount. It completely omits asset verification, provider identity check, emission computation, and lease expiration checks.

Attack & Failure Scenario

  1. Arbitrary XE Minting / Emission Inflation via Quorum:
    • A rogue node (or compromised provider) generates a conflicting BlockLeaseSettle candidate for an active lease escrow.
    • The attacker sets b.Amount = 50,000,000,000 (50 billion XE) instead of the legitimate emission of ~100 XE, and sets b.Balance = parentBalance + 50,000,000,000.
    • In a quorum election for that provider's account, representative nodes invoke ValidateStagedBlock(candidate, parentBalance).
    • ValidateStagedBlock confirms pending != nil and b.Balance == parentBalance + b.Amount. The block passes validation and is accepted into stagedStore!
    • If promoted via confirmConflict / swapBlockLocked, the provider's canonical balance is inflated by 50 billion XE without any attestation or emission verification!
  2. Permanent Consensus Split / Network Partition:
    • Nodes receiving the block via normal gossip/sync ingest it through validateAndAddLeaseSettle.
    • validateAndAddLeaseSettle computes LeaseTotalEmission(lease) and checks attestations, immediately failing with: lease cost mismatch: expected 100, got 50000000000.
    • The network splits: the staging nodes accept the block as valid consensus winner, while all syncing nodes reject it, creating an irreconcilable consensus partition!

Impact

  1. Unbounded Native Token Minting / Economic Collapse: Attackers can claim arbitrarily large XE emission payouts during staged block conflict resolution, minting unbacked XE tokens.
  2. Permanent Consensus Split / BFT Fork: Divergence between ValidateStagedBlock and validateAndAddLeaseSettle breaks consensus determinism across network nodes.

Remediation

In core/ledger.go, update case BlockLeaseSettle in ValidateStagedBlock to verify the asset, lease record, provider authorization, and emission amount:

	case BlockLeaseSettle:
		if b.Asset != "XE" {
			return fmt.Errorf("staged lease_settle: asset must be XE")
		}
		lease, ok, err := l.getLeaseOverlay(b.Source)
		if !ok || err != nil || lease == nil {
			return fmt.Errorf("staged lease_settle: lease not found")
		}
		if lease.Provider != b.Account {
			return fmt.Errorf("staged lease_settle: provider mismatch")
		}
		expectedXE, err := LeaseTotalEmission(lease)
		if err != nil || b.Amount != expectedXE {
			return fmt.Errorf("staged lease_settle: emission mismatch: expected %d, got %d", expectedXE, b.Amount)
		}
		expectedBal := parentBalance + b.Amount
		if expectedBal < parentBalance {
			return fmt.Errorf("staged lease_settle: balance would overflow uint64")
		}
		if b.Balance != expectedBal {
			return fmt.Errorf("staged lease_settle: balance mismatch: expected %d, got %d", expectedBal, b.Balance)
		}

Thread

Joseph Denneteam2026-11-20 00:33 UTCdesk

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