Bounty
XE-16511 · Bounty

[BugBounty][High] Eclipsed lease settle is permanently unrecoverable — archive burns the escrow and the victim can never sync the provider's chain again

Triaging claimed High xe#639 filed 2026-11-17 02:28 UTC by brikzeni

Report

Target: github.com/xeprotocol/xe @ 8cc209d ("release: testnet-0006 build") Severity: High — CVSS 3.1: 7.4 (AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H) Reporter: brikzeni / lolopapa3491@gmail.com — payout XE address 1522be0b3fd8bd46da1021c3e090b7a4b9cdbe8e3eed2c55e66a4440aab07b0e Program area: LEASING / LEDGER, P2P / SYNC

Impact

A lease that was validly settled by its provider is treated as expired with its escrow burned by any node that did not see the settle block before its archive sweep fired — and the loss is permanent and self-reinforcing:

  1. Provider loses the earned settlement emission. Measured live: provider XE 100001034 µXE on the victim node vs 100002068 µXE on the provider's own node — the difference is exactly the lease's 1034 µXE emission.
  2. Consumer's pre-paid escrow is destroyed with no refund. Consumer XCU fell by exactly 517 µXCU per lease on every node and never came back; the archive deletes the pending send with no block, no signature, no gossip.
  3. The victim can never sync the provider's account chain again. The settle is rejected with lease already settled and quarantined. Every later provider block builds on the quarantined settle, so its children are unreachable too. Proven: a fourth lease opened after full re-connection was accepted by the provider within 10 s, but the victim still showed it as created after 60 s and its provider chain stayed frozen at 6 blocks while the provider's chain grew to 9. Only recovery is a database wipe.
  4. The network splits brain on one lease: after re-connection, two nodes said settled (provider paid) while two said expired (escrow burned) — for the same lease hash, permanently.

Proof (live 4-node private network, self-authored genesis, throwaway keys — no live testnet touched)

Network round5-local: V (victim), P (peer), M (provider, --provide), T (timekeeper). Lease min 60 s, settle grace 120 s, escrow expiry 300 s, archive gap 30 s.

  • Lease 1 (control): settled normally on all 4 nodes. Settle path works when connected.
  • Lease 2 (control): provider down during its settle window, so no settle ever existed. Victim archived it at ~01:57:30 UTC (expired, settled: true). Archive fires on schedule.
  • Lease 3 (the test): accepted on all 4 nodes (~01:59 UTC), then the network was split into two islands V↔P and M↔T (peer counts verified 1,1,1,1). M auto-settled in-window at 02:00:12 UTC — settle block ecf6596dc4f742c5…, amount 1034 µXE, attested by 2/3 timekeepers. It never reached V/P. V archived lease 3 at 02:06:13 UTC (expired, settled: true).
  • Decisive step: POST /blocks/lease_settle to V with the exact settle block bytes returned {"error":"block rejected: lease already settled","retryable":false}, HTTP 400.
  • After full re-connection: V's provider chain stayed at 6 blocks; V's log: sync: block ecf6596dc4f7... rejected (quarantined): lease already settled. Lease 4 (opened after re-connection) was accepted on M in 10 s but never appeared on V.

Root cause

  1. The archive verdict is local and final: archiveExpiredLease deletes the pending send and PutLeases State=Expired, Settled=true, emitting no block — nothing is gossiped, nothing can be validated or replayed.
  2. validateAndAddLeaseSettle (core/ledger.go:2252) checks lease.Settled first (line 2271, before attestations, grace, amount, escrow), so a cryptographically valid, correctly attested, in-grace settle is rejected deterministically — forever, on every sync attempt. (The quarantine entry itself is FIFO-evicted / cleared on restart, but the rejection re-occurs on the next sync; observed V re-quarantining the same settle immediately after a restart.)
  3. net/sync.go quarantines the rejected block by hash and marks its children unreachable/skipped, freezing the victim's view of that provider at the accept block. The archive gate (QuietRoundSince) is not the defect — it worked as designed (V and P completed clean rounds). The defect is that the gate can only see the victim's connected peers while the archive's verdict is irrevocable.

Why this is not #381, #310, or #167

  • #381 ("archiveExpiredLease blind overwrite races concurrent settle/renew") is a local race: the archive blind-PutLeases over a settle/renew the same node already knew about (stale snapshot, no CAS/re-read). Its fix (re-read/CAS) does not fix this finding: here the victim's state at archive time was genuinely accepted, not settled — the settle never existed on the victim, so a re-read returns the same state and the archive fires identically. Different root cause, trigger, and fix.
  • #310 is about the archive emitting no block (audit defect); its detail was withdrawn to a desk ticket. The escrow burn here is the same fact, but this finding is the eclipse + permanent unrecoverability of a valid settle.
  • #167 is quarantine poisoning by a bad-signature copy; here the quarantined block is genuine and correctly attested, quarantined for a state rejection. The #189 fix does not address it.
  • #633 is the opposite direction (a peer preventing the archive).

Preconditions (honest)

The victim must be unable to receive the settle for one archive window (~6.5 min after a 60 s lease). That needs a targeted eclipse (AC:H — hence High, not Critical) or, as an untested hypothesis, a node restarting after downtime whose archive sweep fires before its first sync round delivers the settle. Impact per lease is bounded (one emission + one escrow), but the desync is unbounded in time.

Fix suggestions

  1. Accept a late valid settle for an archived lease when its attestations prove settleTime is within [expiry, expiry+grace] — a cryptographically valid settle should outrank a local best-effort archive verdict.
  2. Do not quarantine state-rejected settles permanently; keep them as "pending reconciliation" and retry when lease state changes.
  3. Make the archive emit a block (as #310 argues) so peers can detect and dispute it.
  4. Defence in depth: require the archive gate to have completed a sync round with the lease's provider since escrow expiry before archiving that provider's leases.

Reproduction

Private network only (no live testnet). Genesis + harness + scripts: harness/mkgenesis.go, start-nodes.sh full|split, harness/submit-lease.go (the xe lease CLI hardcodes the live-testnet nodes and cannot be used on a private network), run-lease3.sh, captured settle block settle-block-lease3.json (ecf6596dc4f742c5…), and the 400 response in settle-submit-to-v.txt. Steps: full mesh → submit lease → wait for accepted on the victim → restart all four nodes in split mode (V↔P, M↔T) → provider auto-settles in-window → wait start+390 s for the victim's archive → POST the settle to the victim's /blocks/lease_settle → observe the 400 → re-connect full mesh → observe the frozen provider chain + quarantine log line → open a new lease and observe the victim never sees its accept. Full detail, including control leases 1–2, balances, and code paths, is in the accompanying finding file.

Thread

Joseph Denneteam2026-11-22 23:27 UTCgithub

Thanks for the report. We are reading the case of a node that missed a settlement, marked the lease finished on its own, and then refused the settlement when it arrived.

brikzeni2026-11-25 12:22 UTCweb

Hi Joseph, just following up on this report. Please let me know if any additional evidence or clarification is needed to assist with the investigation. Thank you!