{"id":"XE-10279","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":730,"title":"Collateral Slashing Evasion: validateAndAddSend checks raw frontier balance instead of unencumbered stake allowing providers to drain locked collateral","area":"leasing-ledger","claimed_tier":null,"assessed_tier":null,"verdict":"invalid","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"invalid","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-12T11:27:41.377472+00:00","updated_at":"2026-11-20T00:48:52.048702+00:00","source_created_at":null,"told_at":"2026-11-20T00:48:52.051208+00:00","status_changed_at":"2026-11-20T00:33:25.457109+00:00","url":"https://bounty.xe.network/XE-10279","body":"## Vulnerability Summary\n\nIn `core/ledger.go:972-1002`, `validateAndAddSend` validates whether an account has sufficient balance to execute a transfer:\n\n```go\nfunc (l *Ledger) validateAndAddSend(b *Block) error {\n...\n\toldBal := l.getAssetBalanceOverlay(b.Account, b.Asset)\n\tif b.Amount == 0 {\n\t\treturn fmt.Errorf(\"send amount must be > 0\")\n\t}\n\tif b.Amount > oldBal {\n\t\treturn fmt.Errorf(\"insufficient balance: have %d, sending %d\", oldBal, b.Amount)\n\t}\n\tif b.Balance != oldBal-b.Amount {\n\t\treturn fmt.Errorf(\"balance mismatch: expected %d, got %d\", oldBal-b.Amount, b.Balance)\n\t}\n```\n\nWhen 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`).\n\nBecause `validateAndAddSend` compares `b.Amount` against `l.getAssetBalanceOverlay(b.Account, b.Asset)` (the raw unencumbered balance) rather than deducting active, locked lease stakes:\n1. A provider can accept multiple leases and commit hundreds of thousands of XUSD in collateral stake.\n2. Immediately following lease acceptance, the provider creates and submits a `BlockSend` transferring their entire XUSD balance to an external wallet or exchange address.\n3. `validateAndAddSend` permits the transfer because `b.Amount <= oldBal`.\n4. If the provider subsequently defaults, shuts down the VM, or acts maliciously, the consumer issues a `BlockLeaseForceSettle`.\n5. 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.\n\n## Impact & Severity\n\n1. 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.\n2. Protocol Insolvency & Escrow Breakdown: Breaks the fundamental economic security guarantee of the XE decentralized cloud, allowing unbacked computational offers.\n\n## Proposed Remediation\n\nIn `validateAndAddSend`, enforce that `oldBal` subtracts all active locked stakes across active accepted leases:\n```go\n\tlockedStake := l.getActiveLockedStake(b.Account, b.Asset)\n\tspendable := oldBal - lockedStake\n\tif oldBal < lockedStake || b.Amount > spendable {\n\t\treturn fmt.Errorf(\"insufficient spendable balance: have %d (%d locked in active leases), sending %d\", oldBal, lockedStake, b.Amount)\n\t}\n```","patch_refs":[],"thread":[{"id":13345,"source":"desk","source_ref":"reply:11367","author":"XE desk","team":true,"body":"Thanks for the report. We read it against the code and could not confirm a bug in what it describes.\n\nThis report is closed as invalid. If we have missed something, file a new report that links\nhttps://bounty.xe.network/XE-10279 and says what; it is read like any other.","created_at":"2026-11-20T00:48:52.048702+00:00"}]}