[Minor] desk: full_chain trusts the node-served total with no page cap — a lying node OOMs any caller (XE-1189 residual)
Report
Summary
The desk client's full_chain() pages through an account's chain until the node says stop — it trusts the node-served total and has no page, block, byte, or time cap. A lying or compromised node serving total=2e9 keeps the caller fetching and buffering forever until OOM. The DAO copy of the same client caps at MAX_CHAIN_PAGES=100 (the XE-1189 fix, awarded Minor); the desk copy never got it. This is the 6th "fix reached one copy only" pair.
Location
desk/xe/client.py:99-109(full_chain)desk/xe/client.py:96(chain— one page, limit 1000)dao/xe/client.py:38,:323(MAX_CHAIN_PAGES = 100— the XE-1189 fix the desk copy lacks)
Description
# desk/xe/client.py:99-109 — full_chain
async def full_chain(self, address: str) -> list[dict]:
out: list[dict] = []
offset = 0
while True:
page = await self.chain(address, offset=offset, limit=1000)
blocks = page.get("blocks", [])
out.extend(blocks)
if len(blocks) < 1000 or len(out) >= int(page.get("total", 0)):
break
offset += len(blocks)
return out
The loop breaks only on a short page or when len(out) reaches the node-served total. total is node-controlled: a lying node that keeps returning full 1000-block pages with total=2e9 makes the caller fetch and buffer unbounded blocks. There is no page cap, no block cap, no byte cap, no time cap. The DAO copy of the same client has MAX_CHAIN_PAGES = 100 (the XE-1189 fix); the desk copy has nothing.
PoC (executed, stub node): a stub returning full 1000-block pages with total=2e9 — full_chain was still fetching after 51 requests, with no cap in sight.
Impact
A lying or compromised node OOMs any full_chain caller. Same defect as awarded XE-1189 (DAO original: lying node, total=2e9, OOM-killed worker), in the copy it did not cover.
Honest framing: in-service, the desk calls exactly ONE client method — chain.node() via refresh_node (desk/desk/context.py:47) — so the live desk service does not call full_chain today. The defect is in the shared xe/ package's library surface, the same footing as XE-11872 (Envelope.from_json, judged SOLID Minor with no in-service caller). Any other consumer of the desk client (scripts, tools, future callers) inherits the unbounded read.
Reproduction
- Point the desk client at a stub node returning full 1000-block pages with
total=2e9. - Call
full_chain(address). - Observe it keeps fetching past 51 pages with no cap, buffering every block.
Suggested fix
Mirror the DAO copy: cap pages at MAX_CHAIN_PAGES=100 (and/or cap total blocks/bytes) in full_chain, raising an error when the cap is exceeded instead of looping forever.
Not a duplicate
q=full_chain → 24 (checked 2026-11-14): nearest XE-5418 is the GO client (different copy — truncation on understated total, not the desk client's unbounded loop); XE-12165 is node-side GET /accounts (different component); XE-7935 is the desk client's size cap + 3xx handling (different defect). q=XE-1189 → 6, none about the desk full_chain. q=MAX_CHAIN_PAGES → 2: XE-9693 (DAO snapshot) and XE-5418 (Go client). q=lying node → 11, none about the desk full_chain. No public ticket files the desk client's uncapped full_chain.
Thread
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-12544 and says what differs; it is read like any other.