{"id":"XE-13359","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"385","source_url":"https://github.com/xeprotocol/xe/issues/385","reporter_id":2132,"title":"[Low] GET /pending/{address} ignores ?limit=/?offset= — unbounded per-address response","area":null,"claimed_tier":null,"assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":true,"internal_ref":"","internal_url":null,"status":"accepted","closed_reason":null,"github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:11.396913+00:00","updated_at":"2026-11-18T08:56:06.952873+00:00","source_created_at":"2026-11-11T12:52:30+00:00","told_at":"2026-11-18T08:55:05+00:00","status_changed_at":"2026-11-18T08:39:45.743644+00:00","url":"https://bounty.xe.network/XE-13359","body":"### Summary\n\nEvery 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.\n\n### Impact\n\nOne 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.\n\n### Root cause (repo `github.com/xeprotocol/xe`, commit `89a542ea51d38375299aee54c6c99102e9bfa666`, \"release: testnet-0005 quorum withhold fix\")\n\n`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.\n\n## PoC (all tests PASS)\n\nFile: `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`:\n\n- `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.\n- `TestXE07GlobalPendingRespectsLimit` (control) — the sibling global endpoint `GET /pending?limit=1` returns **exactly 1 entry**. The per-address endpoint is the outlier.\n\nLive 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.\n\nHonest 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.\n\n### Suggested fix\n\nIn `handleGetPending`, call `parsePagination(r)` and `paginateSlice` exactly as `handleGetAllPending` already does — the same one-liner its sibling has.\n\n### Distinct from\n\n- #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.\n- XE-04 — same distinction: XE-04 was \"limit doesn't reach the work\" (output capped); this endpoint has no limit at all.\n- XE-06 — the pool itself (no expiry/cap on pending sends); this is the read side.\n- 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.\n\n### Environment\n\n- Codebase: `github.com/xeprotocol/xe` @ `89a542e` (2026-11-10)\n- Go 1.25.0, `go test` as above, local reproduction only (live testnet used only for read-only observations)\n\nXE payout address: e3d3e4407fec5a846201c7ed8560484ffb881cc30068745a110dd8efb824500c","patch_refs":[{"id":547,"repo":"xeprotocol/xe","kind":"pr","ref":"408","title":"fix(api): respect pagination limit and offset in GET /pending/{address} (Fixes #385)","url":"https://github.com/xeprotocol/xe/pull/408","note":"","state":"open","author":"kleitonbernardino-lab","added_by":"desk","created_at":"2026-11-14T20:42:19.973374+00:00"},{"id":554,"repo":"xeprotocol/xe","kind":"pr","ref":"414","title":"fix(api): apply pagination offset to /blocks/recent and paginate /pending/{address} (#390, #385)","url":"https://github.com/xeprotocol/xe/pull/414","note":"","state":"open","author":"arturbarszcz78","added_by":"desk","created_at":"2026-11-14T20:42:20.063853+00:00"},{"id":733,"repo":"xeprotocol/xe","kind":"pr","ref":"882","title":"fix(xe): low--get--pending--address--i (fixes #385)","url":"https://github.com/xeprotocol/xe/pull/882","note":"","state":"open","author":"tipprb","added_by":"desk","created_at":"2026-11-19T18:56:43.864492+00:00"}],"thread":[{"id":3137,"source":"github","source_ref":"6807079268","author":"kleitonbernardino-lab","team":false,"body":"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.","created_at":"2026-11-11T21:08:49+00:00"},{"id":11551,"source":"github","source_ref":"6973755365","author":"XE desk","team":true,"body":"Read and accepted. It is tracked internally and the fix will land in a public PR; this issue is\nupdated when it does, and the tier and award follow the fix. The desk entry is https://bounty.xe.network/XE-13359.","created_at":"2026-11-18T08:55:05+00:00"}]}