{"id":"XE-10098","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":730,"title":"Lease Allocation Failure & Rejection: pickProvider hardcodes stake to 1 selecting undercapitalized providers rejected by consensus","area":"sdk-docs-web","claimed_tier":null,"assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-12T09:53:45.714708+00:00","updated_at":"2026-11-20T00:33:20.106710+00:00","source_created_at":null,"told_at":"2026-11-20T00:33:20.131693+00:00","status_changed_at":"2026-11-20T00:33:20.116181+00:00","url":"https://bounty.xe.network/XE-10098","body":"## Vulnerability Summary\n\nIn `cmd/xe/main.go:1024-1045` and `1719-1743`, `cmdLease` automatically selects a provider for consumer leases when `--provider` is not explicitly supplied:\n\n```go\n\tif providerAddr == \"\" {\n\t\tproviderAddr = pickProvider(c, vcpus, memory, disk, 1)\n\t}\n...\n\tcost, err := core.LeaseCost(vcpus, memory, disk, duration, certMult)\n\tif err != nil {\n\t\tfatal(\"cost calculation: %v\", err)\n\t}\n\tstake := core.LeaseStake(cost)\n```\n\nIn `pickProvider`:\n```go\nfunc pickProvider(c *client.Client, vcpus, memoryMB, diskGB, stake uint64) string {\n...\n\tfor i := range providers {\n\t\tp := &providers[i]\n\t\tif !providerFits(p, vcpus, memoryMB, diskGB) {\n\t\t\tcontinue\n\t\t}\n\t\tbals, _ := c.GetBalances(p.Account)\n\t\tif bals[\"XUSD\"] >= stake && bals[\"XUSD\"] > bestXUSD {\n\t\t\tbest = p\n\t\t\tbestXUSD = bals[\"XUSD\"]\n\t\t}\n\t}\n\tif best == nil {\n\t\tfatal(\"no provider with sufficient resources and stake\")\n\t}\n\treturn best.Account\n}\n```\n\nThe stake parameter passed to `pickProvider` is hardcoded to literal `1` (`pickProvider(c, vcpus, memory, disk, 1)`) instead of computing `core.LeaseStake(cost)` beforehand.\n\nIn the XE protocol consensus rules (`core/ledger.go:1675-1725`), when a provider attempts to accept a lease (`BlockLeaseAccept`), consensus requires the provider to hold a minimum balance of `LeaseStake(cost)` (which is 10% to 50% of the total lease cost in XUSD).\n\nBecause `pickProvider` only checks `bals[\"XUSD\"] >= 1`:\n1. It selects providers holding nominal balances (e.g., 0.000001 XUSD) who cannot satisfy `LeaseStake(cost)`.\n2. The consumer commits XUSD escrow to a lease block that the selected provider cannot accept.\n3. The lease enters an unfillable pending state until timeout or cancellation, locking up consumer funds.\n\nAdditionally, `pickSubmitNode` (lines 1744-1760) hardcodes legacy testnet domains (`https://ldn.core.test.network`, `https://ffm.core.test.network`, `https://nyc.core.test.network`), causing block submission failures on mainnet or custom RPC networks.\n\n## Proposed Remediation\n\n1. Compute cost and stake before calling `pickProvider`:\n   ```go\n   // Pre-calculate estimated cost and stake with default or target multiplier\n   estCost, _ := core.LeaseCost(vcpus, memory, disk, duration, core.PriceMultiplierDefault)\n   reqStake := core.LeaseStake(estCost)\n   providerAddr = pickProvider(c, vcpus, memory, disk, reqStake)\n   ```\n2. Refactor `pickSubmitNode` to dynamically query node peers from `c.NodeInfo()` instead of static testnet hostnames.","patch_refs":[],"thread":[{"id":13244,"source":"desk","source_ref":"reply:11266","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-10098 and says what differs; it is read like any other.","created_at":"2026-11-20T00:33:20.106710+00:00"}]}