{"id":"XE-12544","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":2086,"title":"[Minor] desk: full_chain trusts the node-served total with no page cap — a lying node OOMs any caller (XE-1189 residual)","area":"other","claimed_tier":"minor","assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T06:27:03.684595+00:00","updated_at":"2026-11-20T19:45:55.723915+00:00","source_created_at":null,"told_at":"2026-11-20T19:45:55.755956+00:00","status_changed_at":"2026-11-20T19:45:55.732211+00:00","url":"https://bounty.xe.network/XE-12544","body":"## Summary\r\n\r\nThe 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.\r\n\r\n## Location\r\n\r\n- `desk/xe/client.py:99-109` (`full_chain`)\r\n- `desk/xe/client.py:96` (`chain` — one page, limit 1000)\r\n- `dao/xe/client.py:38`, `:323` (`MAX_CHAIN_PAGES = 100` — the XE-1189 fix the desk copy lacks)\r\n\r\n## Description\r\n\r\n```python\r\n# desk/xe/client.py:99-109 — full_chain\r\nasync def full_chain(self, address: str) -> list[dict]:\r\n    out: list[dict] = []\r\n    offset = 0\r\n    while True:\r\n        page = await self.chain(address, offset=offset, limit=1000)\r\n        blocks = page.get(\"blocks\", [])\r\n        out.extend(blocks)\r\n        if len(blocks) < 1000 or len(out) >= int(page.get(\"total\", 0)):\r\n            break\r\n        offset += len(blocks)\r\n    return out\r\n```\r\n\r\nThe 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.\r\n\r\nPoC (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.\r\n\r\n## Impact\r\n\r\nA 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.\r\n\r\nHonest 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.\r\n\r\n## Reproduction\r\n\r\n1. Point the desk client at a stub node returning full 1000-block pages with `total=2e9`.\r\n2. Call `full_chain(address)`.\r\n3. Observe it keeps fetching past 51 pages with no cap, buffering every block.\r\n\r\n## Suggested fix\r\n\r\nMirror 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.\r\n\r\n## Not a duplicate\r\n\r\n`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`.","patch_refs":[],"thread":[{"id":15347,"source":"desk","source_ref":"reply:13238","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-12544 and says what differs; it is read like any other.","created_at":"2026-11-20T19:45:55.723915+00:00"}]}