<!-- XE-12544 · [Minor] desk: full_chain trusts the node-served total with no page cap — a lying node OOMs any caller (XE-1189 residual) · testnet -->
*Markdown view of <https://bounty.xe.network/XE-12544>. The page is the record; this is the same page for reading.*

XE-12544 · Bounty

# \[Minor\] desk: full\_chain trusts the node-served total with no page cap — a lying node OOMs any caller (XE-1189 residual)

Closed · duplicate
—claimed Minor
web
filed 2026-11-14 06:27 UTC
by xe:342640c4

Verdict
:   Duplicate

Tier
:   —

Claimed
:   Minor

Area
:   Other

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 19:45 UTC

Told
:   2026-11-20 19:45 UTC

### Patches

None linked.

### History

- [626277](https://bounty.xe.network/log/626277) 2026-11-20 19:45 UTC proposal.adopted
- [626276](https://bounty.xe.network/log/626276) 2026-11-20 19:45 UTC reply.sent
- [626275](https://bounty.xe.network/log/626275) 2026-11-20 19:45 UTC ticket.status new → closed
- [622272](https://bounty.xe.network/log/622272) 2026-11-20 19:44 UTC proposal.adopted
- [622271](https://bounty.xe.network/log/622271) 2026-11-20 19:44 UTC ticket.facts area
- [622268](https://bounty.xe.network/log/622268) 2026-11-20 19:44 UTC proposal.adopted
- [622267](https://bounty.xe.network/log/622267) 2026-11-20 19:44 UTC ticket.facts
- [622264](https://bounty.xe.network/log/622264) 2026-11-20 19:44 UTC proposal.adopted
- [622263](https://bounty.xe.network/log/622263) 2026-11-20 19:44 UTC ticket.facts
- [612562](https://bounty.xe.network/log/612562) 2026-11-20 15:26 UTC note.added
- [612561](https://bounty.xe.network/log/612561) 2026-11-20 15:26 UTC proposal.created
- [612560](https://bounty.xe.network/log/612560) 2026-11-20 15:26 UTC proposal.created

[Full history](https://bounty.xe.network/log?ref=XE-12544) · [JSON](https://bounty.xe.network/v1/tickets/XE-12544) · [markdown](https://bounty.xe.network/XE-12544.md)

### 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

1. Point the desk client at a stub node returning full 1000-block pages with `total=2e9`.
2. Call `full_chain(address)`.
3. 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

**Joseph Denne**team2026-11-20 19:45 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-12544 and says what differs; it is read like any other.
