Bounty
XE-10279 · Bounty

Collateral Slashing Evasion: validateAndAddSend checks raw frontier balance instead of unencumbered stake allowing providers to drain locked collateral

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

Report

Vulnerability Summary

In core/ledger.go:972-1002, validateAndAddSend validates whether an account has sufficient balance to execute a transfer:

func (l *Ledger) validateAndAddSend(b *Block) error {
...
	oldBal := l.getAssetBalanceOverlay(b.Account, b.Asset)
	if b.Amount == 0 {
		return fmt.Errorf("send amount must be > 0")
	}
	if b.Amount > oldBal {
		return fmt.Errorf("insufficient balance: have %d, sending %d", oldBal, b.Amount)
	}
	if b.Balance != oldBal-b.Amount {
		return fmt.Errorf("balance mismatch: expected %d, got %d", oldBal-b.Amount, b.Balance)
	}

When a provider accepts a lease via BlockLeaseAccept (core/ledger.go:1675-1735), the provider commits an XUSD collateral stake (b.Amount = Stake). However, this stake is not deducted from the account's frontier Balance field—it is merely recorded in the Lease object (commit.PutLease.Stake = b.Amount).

Because validateAndAddSend compares b.Amount against l.getAssetBalanceOverlay(b.Account, b.Asset) (the raw unencumbered balance) rather than deducting active, locked lease stakes:

  1. A provider can accept multiple leases and commit hundreds of thousands of XUSD in collateral stake.
  2. Immediately following lease acceptance, the provider creates and submits a BlockSend transferring their entire XUSD balance to an external wallet or exchange address.
  3. validateAndAddSend permits the transfer because b.Amount <= oldBal.
  4. If the provider subsequently defaults, shuts down the VM, or acts maliciously, the consumer issues a BlockLeaseForceSettle.
  5. When the protocol attempts to slash the provider's forfeited stake, the provider's account balance is already zero. The consumer and protocol are left completely uncompensated.

Impact & Severity

  1. Total Collateral Evasion: Malicious compute providers can offer fake hardware, accept leases, immediately siphon out their committed collateral via BlockSend, and walk away with zero risk of financial loss from slashing.
  2. Protocol Insolvency & Escrow Breakdown: Breaks the fundamental economic security guarantee of the XE decentralized cloud, allowing unbacked computational offers.

Proposed Remediation

In validateAndAddSend, enforce that oldBal subtracts all active locked stakes across active accepted leases:

	lockedStake := l.getActiveLockedStake(b.Account, b.Asset)
	spendable := oldBal - lockedStake
	if oldBal < lockedStake || b.Amount > spendable {
		return fmt.Errorf("insufficient spendable balance: have %d (%d locked in active leases), sending %d", oldBal, lockedStake, b.Amount)
	}

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