<!-- XE-0610 · [Bundle] API consistency: GET /directory silently truncates to 100 of 217 entries (no total/cursor) + /chat/messages ignores every pagination parameter + chat inbox flooding evicts a victim's full his · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0610>. The page is the record; this is the same page for reading.*

XE-0610 · Bounty

# \[Bundle\] API consistency: GET /directory silently truncates to 100 of 217 entries (no total/cursor) \+ /chat/messages ignores every pagination parameter \+ chat inbox flooding evicts a victim's full his

Triaging
claimed Medium
web
filed 2026-11-05 06:20 UTC
by Gilang buana sultoni

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   Medium

Area
:   Node / API

Duplicate of
:   —

Tracked
:   internally

Updated
:   2026-11-11 10:14 UTC

Told
:   2026-11-08 20:18 UTC

### Patches

None linked.

### History

- [43655](https://bounty.xe.network/log/43655) 2026-11-08 20:18 UTC proposal.adopted
- [43654](https://bounty.xe.network/log/43654) 2026-11-08 20:18 UTC reply.sent
- [42388](https://bounty.xe.network/log/42388) 2026-11-08 20:18 UTC proposal.adopted
- [42387](https://bounty.xe.network/log/42387) 2026-11-08 20:18 UTC proposal.adopted
- [42386](https://bounty.xe.network/log/42386) 2026-11-08 20:18 UTC ticket.facts
- [42385](https://bounty.xe.network/log/42385) 2026-11-08 20:18 UTC proposal.adopted
- [42384](https://bounty.xe.network/log/42384) 2026-11-08 20:18 UTC ticket.facts
- [42383](https://bounty.xe.network/log/42383) 2026-11-08 20:18 UTC proposal.adopted
- [42382](https://bounty.xe.network/log/42382) 2026-11-08 20:18 UTC ticket.facts
- [42381](https://bounty.xe.network/log/42381) 2026-11-08 20:18 UTC proposal.adopted
- [42380](https://bounty.xe.network/log/42380) 2026-11-08 20:18 UTC ticket.facts
- [42379](https://bounty.xe.network/log/42379) 2026-11-08 20:18 UTC proposal.adopted

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

### Report

# 🐞 Bug Report (Bug bounty — XE Protocol)

## Summary

Three live-verified API consistency/abuse findings on testnet-0005 (all tested with own registered accounts, ≤10 req/s, evidence transcripts retained):

### 1\. MEDIUM — `GET /directory` silently truncates to 100 of 217 entries

`GET /directory` returns a **bare JSON array capped at 100 entries** with no total count, no cursor, no pagination parameters of its own that lift the cap. 217 accounts are registered (verified via per-account lookups); only the lexicographically-first 100 are ever returned — **117 accounts are permanently invisible to the list view** (they remain reachable via direct `GET /directory/{account}`). Related root cause to XE-0058 (known, capped list) but on this endpoint the cap is *silent*: no header, no field, no way for a consumer to know data is missing. Wallet UIs and indexers listing accounts will systematically miss the majority of the directory.

### 2\. LOW — `/chat/messages` ignores every pagination parameter

With a valid ownership proof (4-message inbox), **12 parameter variants** were tested: `limit=1&offset=0..3`, `limit=2&offset=3`, `offset=-1`, `offset=-99999999999`, `limit=0`, `limit=-1`, `limit=999999`, `offset=9223372036854775807`, `offset=18446744073709551616`, `limit=abc`, `offset=abc`, `since=-5`, `since=99999999999999999999999` — **every variant → 200 with the full inbox**. Parameters are silently swallowed (contrast: `/directory` where limit/offset work, and `/pending//accounts` where they cap at 100). No 500s, no type-name leaks — robust input handling, absent semantics. Impact: unbounded-by-params response size on an authenticated endpoint (self-DoS only) \+ inconsistent pagination contract across three endpoint families. Pairs with #1 as one pagination-contract theme.

### 3\. LOW — chat inbox flooding: one IP can evict a victim's full 1000-msg history in \~100 s and pollute their contact list

Chat has **no per-account rate limit**: the only brakes are the per-IP write bucket (10 req/s, burst 50 — `api/handler.go:295-298`) and per-message PoW (blake2b-8 at 2^-14 ≈ trivial in Go). Live-proven on own accounts (S3/S3b): 1,000 rapid messages → **1000×200, zero 429s**; recipient's 1000-cap FIFO evicts their entire prior history in \~100 seconds, and the sender's address is injected into the victim's derived contact list (contacts are derived from stored envelopes; no contact-mutation API exists, no removal possible). Adjacent code-only issues: the seen-ID map (100k entries, \~10 min aging) can be exhausted to block **all** new chat on a node (`400 duplicate envelope` misnomer), and the P2P chat ingress stores envelopes addressed to *any* account string (no homing check) — enabling third-party mailbox stuffing without connecting to the victim's node.

## Steps to Reproduce

1. (F1) Register ≥101 accounts via `POST /directory/register`; `GET /directory` → exactly 100 entries, no indication of truncation; `GET /directory/{account}` for entry #217 → 200 (it exists, it's just not listed).
2. (F2) Authenticate to `/chat/messages` with a valid proof; append `?limit=1&offset=0`, then `?limit=abc`, `?offset=-1`, etc. → all return the full inbox.
3. (F3) Register sender\+victim; send 1,000 messages (PoW per message; ≤10 req/s sustained) → victim's pre-existing messages evicted FIFO; victim's `GET /chat/contacts` now contains the sender.

## Impact

- F1: directory consumers (wallet UIs, indexers, monitoring) silently operate on 45% of the data — integrity of public directory views.
- F2: inconsistent API contract; unbounded responses.
- F3: targeted history-wipe \+ contact pollution of any account by a single IP; node-wide chat DoS via seen-map exhaustion (code-only).

## Suggested fix

- F1: return `{entries, total, next_cursor}` (or an explicit truncation flag); document the cap.
- F2: parse\+enforce `limit`/`offset`/`since` on `/chat/messages` (or reject unknown params with 400\) — one shared pagination helper for all list endpoints.
- F3: per-account send rate limit (independent of the IP bucket); consider a contact-visibility rule (only derive contacts from received messages above a threshold, or allow contact removal); add a homing check on P2P chat ingress (drop envelopes addressed to unknown accounts).

### Thread

**Joseph Denne**team2026-11-08 20:17 UTCdesk

Thanks for the bundle. The inbox-flooding item is already on file from an earlier report and will be handled there; the two pagination items are being reviewed as API consistency work. We will update you here: https://bounty.xe.network/XE-0610
