Bounty
XE-9818 · Bounty

Provider Resource Oversubscription Race: autoAcceptLease checks acceptPolicy.Allow before blockCreateMu permitting concurrent VM capacity exhaustion

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

Report

Vulnerability Summary

In node/node.go:1460-1535, autoAcceptLease(leaseBlock *core.Block) handles automated acceptance of incoming compute lease blocks for provider nodes.

To prevent oversubscribing provider hardware (CPU cores, RAM, and disk space), the provider node relies on n.acceptPolicy.Allow(leaseBlock, n.activeLeaseCount()):

func (n *Node) activeLeaseCount() uint64 {
	if n.VMManager == nil {
		return 0
	}
	return uint64(len(n.VMManager.List()))
}

In node/node.go:1477:

	if err := n.acceptPolicy.Allow(leaseBlock, n.activeLeaseCount()); err != nil {
		log.Printf("Auto-accept policy rejected lease %s: %v", shortHash(leaseBlock.Hash), err)
		return
	}

Notice the critical concurrency race condition:

  1. n.acceptPolicy.Allow is checked early outside of n.blockCreateMu and before n.acceptAttestations (which performs network I/O across timekeeper peers taking hundreds of milliseconds to seconds).
  2. n.activeLeaseCount() counts only VMs currently returned by n.VMManager.List().
  3. In-flight lease acceptances (which have passed policy check but have not yet completed block creation and VM provisioning in n.VMManager.Provision) are completely invisible to n.activeLeaseCount() and n.acceptPolicy.Allow!

Vulnerable Code Locations

  • node/node.go:1477-1510: autoAcceptLease evaluates n.acceptPolicy.Allow using n.activeLeaseCount() at line 1477. Then it performs network attestation gathering (acceptAttestations) without holding blockCreateMu. Multiple concurrent lease requests all read the same un-updated VM count.
  • node/policy.go:33-45: LeaseAcceptPolicy.Allow enforces p.MaxActiveLeases > 0 && activeCount >= p.MaxActiveLeases. Because activeCount comes solely from n.activeLeaseCount(), concurrent leases bypass MaxActiveLeases.

Attack & Failure Scenario

  1. A provider configures MaxActiveLeases = 2 to safely fit within its hardware capacity (e.g. 16 vCPUs total, 8 vCPUs per lease).
  2. A consumer broadcasts 5 simultaneous BlockLease requests targeting this provider.
  3. The provider node receives all 5 blocks and spawns 5 concurrent goroutines running autoAcceptLease.
  4. All 5 goroutines call n.activeLeaseCount(). Since 0 VMs are provisioned yet, all 5 goroutines see activeCount = 0 and pass n.acceptPolicy.Allow.
  5. All 5 goroutines gather attestations in parallel and acquire n.blockCreateMu sequentially.
  6. The provider commits 5 BlockLeaseAccept transactions on-chain, committing 5x XUSD stake.
  7. Subsequently, when the provider attempts to provision VMs for all 5 leases, the host physical server runs out of vCPUs / memory, leading to hypervisor OOM panics, VM launch failures, and subsequent slashing of the provider's reputation and staked XUSD deposits!

Impact

  1. Provider Slashing & Stake Loss: Providers accept more leases than their physical hardware can support, failing to provision VMs and forfeiting their XUSD stakes via BlockLeaseForceSettle.
  2. Host Node Denial of Service / Crash: Hypervisors crash or enter kernel OOM states under severe CPU/RAM overcommitment.

Remediation

Track pending in-flight accepts inside activeLeaseCount() or enforce acceptPolicy.Allow atomically under blockCreateMu accounting for in-flight accepted leases:

func (n *Node) activeLeaseCount() uint64 {
	n.acceptInFlightMu.Lock()
	inFlight := uint64(len(n.acceptInFlight))
	n.acceptInFlightMu.Unlock()

	var vmCount uint64
	if n.VMManager != nil {
		vmCount = uint64(len(n.VMManager.List()))
	}
	return vmCount + inFlight
}

Thread

Joseph Denneteam2026-11-20 00:33 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-9818 and says what differs; it is read like any other.