Staged Block Validation Bypass: ValidateStagedBlock omits lease state, provider authorization, and emission verification on BlockLeaseSettle
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:
b.Asset == "XE"(core/ledger.go:2118-2119).lease.Provider == b.Account(core/ledger.go:2134-2136).!lease.Settledandlease.State == LeaseAccepted(core/ledger.go:2131-2144).settleTime >= expiryandsettleTime <= expiry+LeaseSettleGracevia timekeeper attestations (core/ledger.go:2158-2172).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:
- Never checks
b.Asset == "XE": It allows arbitrary asset tags (e.g. mintingXUSD). - Never loads the lease record (
l.store.GetLease): It checksl.store.GetPendingSend(b.Source), which only verifies that an escrow exists! - Never verifies
b.Amount == expectedXE: An attacker can setb.Amountto any arbitrary uint64 value (e.g. 100,000,000 XE) as long asb.Balance == parentBalance + b.Amount! - Never verifies
lease.Provider == b.Account: Any non-provider account can settle the lease! - Never verifies lease expiration or attestations: An unexpired or unaccepted lease can be settled instantly!
Vulnerable Code Locations
core/ledger.go:2793-2808:ValidateStagedBlockforBlockLeaseSettleverifies only thatb.Sourceexists inPendingSendand thatb.Balance == parentBalance + b.Amount. It completely omits asset verification, provider identity check, emission computation, and lease expiration checks.
Attack & Failure Scenario
- Arbitrary XE Minting / Emission Inflation via Quorum:
- A rogue node (or compromised provider) generates a conflicting
BlockLeaseSettlecandidate 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 setsb.Balance = parentBalance + 50,000,000,000. - In a quorum election for that provider's account, representative nodes invoke
ValidateStagedBlock(candidate, parentBalance). ValidateStagedBlockconfirmspending != nilandb.Balance == parentBalance + b.Amount. The block passes validation and is accepted intostagedStore!- If promoted via
confirmConflict/swapBlockLocked, the provider's canonical balance is inflated by 50 billion XE without any attestation or emission verification!
- A rogue node (or compromised provider) generates a conflicting
- Permanent Consensus Split / Network Partition:
- Nodes receiving the block via normal gossip/sync ingest it through
validateAndAddLeaseSettle. validateAndAddLeaseSettlecomputesLeaseTotalEmission(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!
- Nodes receiving the block via normal gossip/sync ingest it through
Impact
- Unbounded Native Token Minting / Economic Collapse: Attackers can claim arbitrarily large XE emission payouts during staged block conflict resolution, minting unbacked XE tokens.
- Permanent Consensus Split / BFT Fork:
Divergence between
ValidateStagedBlockandvalidateAndAddLeaseSettlebreaks 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
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.