Bounty
XE-16988 · Bounty

[Low] client.GetLeases returns at most 100 leases with no pagination — silently truncated

Closed · duplicate — xe#699 filed 2026-11-17 08:12 UTC by kecedanzz77-bit

Report

Summary

client.GetLeases returns at most 100 leases with no pagination — silently truncated. The server paginates and returns a bare array with no total, and the SDK issues a single GET /leases with no params and returns the one page as if complete.

Root Cause

  • Server handleGetLeases (api/handler.go:808) paginates via parsePagination (default limit 100) and returns a bare array with no total.
  • SDK GetLeases (client/client.go:142) issues a single GET /leases with no params and returns the one page as if complete.
  • Contrast GetChain (client/client.go:35), which loops over pages (pageLimit 1000, offset loop).

Verification

Executed PoC against the real api.Handler (httptest + fake backend):

GetLeases: backend=250 SDK returned=100 (silently truncated, no total in response)

Note on related reports

Searched GetLeases pagination client and leases truncated 100 limit SDK — no hits. Distinct from #647 (GetChain loop termination) and #390 (server ignores ?offset= on /blocks/recent — different endpoint, server-side mechanism).

Suggested fix

Loop over pages in GetLeases like GetChain does, or return the total/pagination metadata so callers can detect truncation.

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-16988 and says what differs; it is read like any other.