Bounty
XE-16713 · Bounty

[High] Lease-block validity depends on the node's local off-chain certset; certificate eviction makes historical lease blocks unvalidatable (consensus non-determinism + permanent sync breakage)

Closed · duplicate —claimed High xe#651 filed 2026-11-17 05:17 UTC by kecedanzz77-bit

Report

Summary

Performance certificates are not on-chain -- a lease block stores only the cert hash. But the ledger validates the lease/accept/renew cost against the cert's PriceMultiplierMilli, fetched from the node's local, gossiped, capped certset (256 per provider). Two honest nodes with different certsets reach opposite verdicts on the identical block, and a cert evicted network-wide can never be recovered (it lives nowhere else). A new node syncing from scratch stalls at the first lease block whose cert was evicted -- it cannot validate that account chain past that point, ever.

Root Cause

  • validateAndAddLease (core/ledger.go:1656-1662), validateAndAddLeaseAccept (core/ledger.go:1821-1826), validateAndAddLeaseRenew (core/lease_renew.go:65-70) all reject with "certificate not found" when certificateLookupFn returns nil.
  • certificateInfoByHash (node/perf.go:295-305) reads only the node's local in-memory certset.
  • certSet.put (node/certset.go:25-55) evicts oldest-by-IssuedAt past certRetentionPerProvider = 256.
  • retainCertificate (node/perf.go:358-377) DELETES evicted certs from the persistent store (DeleteCertificate, line 371), so eviction is permanent, not just in-memory.
  • The sync path (AddSyncedBlock -> addBlock -> dispatchValidateAndAdd, core/ledger.go:793-795) runs the same cert-lookup validation; nothing skips it.

Impact

  • Consensus non-determinism: the same lease block is valid on nodes holding the cert and invalid on nodes that evicted it.
  • Permanent sync breakage: a new node syncing from scratch stalls at the first lease block whose cert was evicted.
  • Deliberate history poisoning (cheap): a provider mints 256+ self-asserted certs (trivial -- VerifyCertificateContent, perf/certificate.go:156-216, never verifies PoW or the attestation roots; that enabler is already reported as #392/#594) and gossips them; every node ingests them, evicts the target cert, and deletes it from its store. The provider can thereby make any of its leases' history unvalidatable network-wide.

Verification (executed PoC)

Standalone Go harness (map-backed cert lookup): builds a ledger, mints XCU, creates a lease block referencing a cert -- ACCEPTED on node A. Then deletes the cert from the map (simulating eviction) and replays the identical mint+lease via AddSyncedBlock on a fresh ledger (node B): mint replays fine, the same lease block is REJECTED with certificate aaaaaaaaaaaa... not found. "RESULT: consensus non-determinism confirmed -- identical block, opposite verdicts depending on local off-chain cert state." Audited at HEAD 8cc209d (testnet-0006).

Note on related reports

Adjacent, not duplicate: XE-13481 ("Certificate eviction makes holdLease throw on the missing opening certificate") is an SDK/client helper (holdLease does not exist in this repo) with a client-liveness impact; it does not cover ledger consensus validation or sync breakage, and its fix would not fix this finding. #387 (no global cap -> store/RAM exhaustion) is an adjacent, distinct root cause.

Suggested fix

Persist the cert's pricing inputs (at minimum PriceMultiplierMilli, provider, expiry) in the lease block / lease record at creation so historical validation never needs the gossiped cert; or exempt already-finalized historical lease blocks from the cert lookup; and/or never delete certs referenced by on-chain leases from the store.

Thread

Joseph Denneteam2026-11-22 23:26 UTCdesk

Thanks. This is the same finding as an earlier report that is not public, 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-16713 and says what differs; it is read like any other.