Escrow without service is uncostly: lease_settle verifies only elapsed time, returns the stake, and opens before force-settle
Report
Severity: Critical — escrow theft ("escrow taken without service"). See "Honest caveat".
Area: Compute leasing · core/ledger.go, node/attestation.go
Related: distinct root cause from #20 (see "Distinct from #20").
Summary
lease_settle verifies only that time has passed — a timekeeper attests
sha256(lease_hash || timestamp), never that the provider delivered compute. A provider can
therefore accept a lease, provision nothing, and at expiry settle with a timekeeper-signed
timestamp: the consumer's escrow is burned, the provider keeps their stake and mints XE. Because the
provider's settle window opens before the consumer's force-settle window, and because settlement
returns (rather than forfeits) the stake, this is uncostly and always winnable by the provider.
Root cause
validateAndAddLeaseSettle (core/ledger.go) gates settlement exclusively on time:
// gates: settleTime >= expiry && settleTime <= expiry + LeaseSettleGrace
// no check that a VM was provisioned, or that any compute was delivered
Settlement's side effects are then unconditional:
DeletePendingID = lease hash— the consumer's escrow pending send is deleted (burned),AssetCredit = {Account: provider, Asset: "XUSD", Amount: lease.Stake}— the stake is returned,- the provider's XE balance is credited the emission (newly minted supply),
reputation.Apply(EventLeaseSettled)— a positive reputation event.
The only input a provider must produce is a timekeeper attestation. canAttest
(node/attestation.go) returns nil for any lease in Created/Accepted state — it never checks
that a VM exists or that work was delivered. AttestationPayload is sha256(leaseHash || timestamp):
it binds a clock reading, not a delivery claim.
Why the incentives do not protect the consumer
Three independent facts make this a theft, not a theoretical gap:
- Stake is returned, not forfeited, on settle.
lease_force_settleforfeits the stake, but the provider is the one who settles — and settle refundslease.Stake. A provider loses their stake only if the consumer force-settles, which the provider preempts (next point). - Settle precedes force-settle. The provider may settle at
expiry; the consumer's force-settle is eligible only atexpiry + LeaseSettleGrace + LeaseForceSettleGap(default +1h25m). By the time the consumer can act, the escrow is already burned. - Reputation improves on settle. Settling records
EventLeaseSettled(positive); the "unfulfilled" reputation path only fires on force-settle, which the provider avoids.
Net: settle-without-delivery returns the stake, mints XE, raises the provider's reputation, and burns the consumer's escrow — with no downside.
Impact
- Who: every consumer leasing compute from a malicious provider.
- Worst case: a provider accepts leases, delivers nothing, and settles each one at expiry — draining the full escrowed XUSD of every consumer while minting XE and improving its own standing. There is no dispute mechanism (dispute arbitration is "design stage" in the README), so consumers have no recourse.
- This is the programme's own Critical class: "Leasing: escrow taken without service".
Reproduce
A checkout runs the end-to-end lifecycle with no VM provisioned anywhere:
$ go test ./core -run TestAuditZeroCollateralEmission -v
audit_e2e_test.go:103: provider BEFORE lease: XE=1 XUSD=0
audit_e2e_test.go:129: lease cost = 500 µXUSD
audit_e2e_test.go:156: required stake = LeaseStake(500) = 0
audit_e2e_test.go:184: provider AFTER accept: XE=1 XUSD=0
audit_e2e_test.go:212: provider FINAL: XE=501 XUSD=0
audit_e2e_test.go:213: consumer FINAL: XE=999999 XUSD=999500 ← escrow burned
audit_e2e_test.go:221: provider minted 500 µXE emission with ZERO XUSD collateral at risk
The full test source is pasted in issue #20. The same block sequence demonstrates this claim: the
provider provisions no VM, obtains an attestation (SignAttestation) that only signs a timestamp,
and AddBlock(settleBlock) succeeds — minting XE and deleting the escrow pending send.
Distinct from #20
#20 (LeaseStakeDivisor = 0) is the collapsed collateral constant. This finding holds even with the
divisor restored to 5: settlement returns the stake (only force-settle forfeits it) and the settle
window precedes force-settle, so a provider whose stake is cost/5 still settles-without-delivery at
no net loss. Fixing #20 does not close this.
Honest caveat (steelman + answer)
- Steelman: settlement cannot prove delivery without a proof-of-uptime system, and the README marks "Proof of uptime 🚧 design stage". So "settlement trusts time, not work" is a known, unfinished piece.
- Answer: the report is not "the feature is missing" — it is that the current ordering and accounting make the gap uncostly and always-winnable. The stake is returned (not forfeited) on the path the attacker controls, settle opens before force-settle, and settle improves reputation. Those are concrete, separable defects, not merely the absence of a not-yet-built feature.
Remediation
Any of (in order of preference):
- Require a delivery/uptime attestation before the stake is returned, and forfeit the stake when it is absent.
- Open the consumer's force-settle window at the same instant as the provider's settle window, so a non-delivering provider cannot win the race.
- At minimum, do not return
lease.Stakeon settle without a delivery proof, and record a disputed/unfulfilled reputation event (notEventLeaseSettled) when a settle carries no delivery attestation.
Thread
Read and accepted. It is tracked internally and the fix will land in a public PR; this issue is updated when it does, and the tier and award follow the fix. The desk entry is https://bounty.xe.network/XE-0012.