<!-- XE-13359 · [Low] GET /pending/{address} ignores ?limit=/?offset= — unbounded per-address response · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13359>. The page is the record; this is the same page for reading.*

XE-13359 · Bounty

# \[Low\] GET /pending/{address} ignores ?limit\=/?offset\= — unbounded per-address response

Accepted
[xe#385](https://github.com/xeprotocol/xe/issues/385)
filed 2026-11-11 12:52 UTC
by akitaBugBounty

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   —

Area
:   —

Duplicate of
:   —

Tracked
:   internally

Updated
:   2026-11-18 08:56 UTC

Told
:   2026-11-18 08:55 UTC

### Patches

- [xe#408](https://github.com/xeprotocol/xe/pull/408) open by kleitonbernardino-lab
  fix(api): respect pagination limit and offset in GET /pending/{address} (Fixes #385)
- [xe#414](https://github.com/xeprotocol/xe/pull/414) open by arturbarszcz78
  fix(api): apply pagination offset to /blocks/recent and paginate /pending/{address} (#390, #385)
- [xe#882](https://github.com/xeprotocol/xe/pull/882) open by tipprb
  fix(xe): low--get--pending--address--i (fixes #385)

### History

- [529838](https://bounty.xe.network/log/529838) 2026-11-19 18:56 UTC patch.linked
- [480727](https://bounty.xe.network/log/480727) 2026-11-18 08:55 UTC reply.mirrored
- [480716](https://bounty.xe.network/log/480716) 2026-11-18 08:54 UTC reply.sent
- [480405](https://bounty.xe.network/log/480405) 2026-11-18 08:40 UTC github.labels
- [480385](https://bounty.xe.network/log/480385) 2026-11-18 08:39 UTC ticket.status triaging → accepted
- [480384](https://bounty.xe.network/log/480384) 2026-11-18 08:39 UTC ticket.status new → triaging
- [480383](https://bounty.xe.network/log/480383) 2026-11-18 08:39 UTC ticket.facts
- [205830](https://bounty.xe.network/log/205830) 2026-11-14 20:42 UTC patch.linked
- [205823](https://bounty.xe.network/log/205823) 2026-11-14 20:42 UTC patch.linked
- [205731](https://bounty.xe.network/log/205731) 2026-11-14 20:42 UTC note.added
- [205730](https://bounty.xe.network/log/205730) 2026-11-14 20:42 UTC ticket.created

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

### Report

### Summary

Every other list endpoint in `api/handler.go` paginates its output through `parsePagination` \+ `paginateSlice` (max 1000, default 100): `/accounts`, `/frontiers`, `/pending` (global), `/accounts/{address}/chain`, `/leases`, `/conflicts`, `/directory`. The single exception is `GET /pending/{address}` (`handleGetPending`, `api/handler.go:529`): it never calls `parsePagination` at all, so `?limit=` / `?offset=` are silently ignored and the endpoint returns **all** pending sends for that address at once — and `enrichPending` (`:555`) additionally performs one `GetBlock` lookup per entry.

### Impact

One unauthenticated GET — also reachable through the explorer UI's `/api/` proxy on port 8000 — returns a response that grows without bound with the victim's pending count. Inflating a victim's pending list is already proven cheap by XE-06 (1-micro-XE sends, no fee, PoW-only, fully reclaimable), so the amplifier is real. No funds are at risk and there is no consensus impact — this is read-side amplification / an unbounded response, hence Low, not Medium.

### Root cause (repo `github.com/xeprotocol/xe`, commit `89a542ea51d38375299aee54c6c99102e9bfa666`, "release: testnet-0005 quorum withhold fix")

`handleGetPending` (`api/handler.go:529`) is the only list handler that never calls `parsePagination` (a repo-wide check: every other list handler — `:461`, `:622`, `:629`, `:666`, `:689`, `:697`, `:728`, `:824`, `:896` — calls it). Its sibling `handleGetAllPending` (`:622`) already paginates; the fix is the same one-liner.

## PoC (all tests PASS)

File: `api/xe07_pending_address_test.go` (test-only, no production code changed). Run with `TMPDIR=$HOME/workspace/xe-audit/tmp GOPROXY=direct go test ./api/ -run TestXE07 -v`:

- `TestXE07PendingAddressIgnoresLimit` — 10 pending sends to one victim; `GET /pending/{victim}?limit=1` returns **all 10 entries** (and `?limit=1&offset=9` also returns 10/10) — limit/offset ignored, output uncapped.
- `TestXE07GlobalPendingRespectsLimit` (control) — the sibling global endpoint `GET /pending?limit=1` returns **exactly 1 entry**. The per-address endpoint is the outlier.

Live context (testnet-0005, LDN, read-only GETs, 11 Nov 2026): the global pool holds 332,011 pending sends; a 1,000-entry sample shows 930 distinct destinations (max 8 per address in the sample), so no single address is fat TODAY — the amplifier needs an attacker to first inflate a victim's pending list. That inflation is cheap and already proven by XE-06, which is why this is rated Low, not Medium.

Honest limits: the PoC proves handler behaviour against an in-memory ledger, not live-node saturation (load test forbidden by the bounty scope). No live pending inflation was performed (state-changing — forbidden); the cheapness of inflation relies on the XE-06 PoC.

### Suggested fix

In `handleGetPending`, call `parsePagination(r)` and `paginateSlice` exactly as `handleGetAllPending` already does — the same one-liner its sibling has.

### Distinct from

- #70 (`/accounts`) and #215 (`/frontiers`) — pagination where the output IS capped at 1000 and only the server work is unbounded. Here even the OUTPUT is unbounded.
- XE-04 — same distinction: XE-04 was "limit doesn't reach the work" (output capped); this endpoint has no limit at all.
- XE-06 — the pool itself (no expiry/cap on pending sends); this is the read side.
- Honest note on the duplicate check: GitHub MCP `search_issues` returned 0 for every keyword, including "pagination" which definitely exists in #70 — the tool cannot be relied on. Distinctness here rests on code (handler.go: only `handleGetPending` skips `parsePagination`) and on the substance difference above, not on the search result.

### Environment

- Codebase: `github.com/xeprotocol/xe` @ `89a542e` (2026-11-10)
- Go 1.25.0, `go test` as above, local reproduction only (live testnet used only for read-only observations)

XE payout address: e3d3e4407fec5a846201c7ed8560484ffb881cc30068745a110dd8efb824500c

### Thread

**kleitonbernardino-lab**2026-11-11 21:08 UTCgithub

Opened PR #408 to resolve this issue by applying `parsePagination` and `paginateSlice` to `handleGetPending`, along with comprehensive unit tests for query pagination and boundary handling.

**XE desk**team2026-11-18 08:55 UTCgithub

Read and accepted. It is tracked internally and the fix will land in a public PR; this issue is
updated when it does, and the tier and award follow the fix. The desk entry is https://bounty.xe.network/XE-13359.
