[Low] GET /pending/{address} ignores ?limit=/?offset= — unbounded per-address response
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=1returns all 10 entries (and?limit=1&offset=9also returns 10/10) — limit/offset ignored, output uncapped.TestXE07GlobalPendingRespectsLimit(control) — the sibling global endpointGET /pending?limit=1returns 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_issuesreturned 0 for every keyword, including "pagination" which definitely exists in #70 — the tool cannot be relied on. Distinctness here rests on code (handler.go: onlyhandleGetPendingskipsparsePagination) 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 testas above, local reproduction only (live testnet used only for read-only observations)
XE payout address: e3d3e4407fec5a846201c7ed8560484ffb881cc30068745a110dd8efb824500c
Thread
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.
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.