{"id":"XE-13357","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"502","source_url":"https://github.com/xeprotocol/xe/issues/502","reporter_id":2484,"title":"Per-IP API rate limit is partitioned across proxy instances (~5x the documented 1000 reads/5s / 50 writes/5s)","area":"ops-testnet","claimed_tier":"medium","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":null,"status":"triaging","closed_reason":null,"github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:11.079377+00:00","updated_at":"2026-11-20T00:17:11.541625+00:00","source_created_at":"2026-11-12T08:59:24+00:00","told_at":"2026-11-20T00:15:44+00:00","status_changed_at":"2026-11-20T00:15:30.073715+00:00","url":"https://bounty.xe.network/XE-13357","body":"## Summary\n\nThe documented per-IP rate limit on the public API is not actually shared per client IP — it is partitioned across the load-balanced proxy instances. One client IP is served by several independent token budgets, so the effective ceiling the client can hit before any `429` is returned is several times the documented limit.\n\n## Where\n\n- Versioned proxy: `https://test.network/api/v1/*` (rate-limit headers emitted by the `test.network` proxy / nginx layer).\n- Documented policy (OpenAPI `x-rate-limits`): *\"per client IP, per request class: reads 1000 per 5s (200/s burst 1000), writes 50 per 5s (10/s burst 50), onExceeded 429 with Retry-After.\"*\n\n## What I observed\n\nFor a **single source IP**, across consecutive rapid requests, the `RateLimit-Remaining` value **increases mid-window** and `RateLimit-Reset` reports **multiple distinct values concurrently** — both impossible for one shared fixed-window counter:\n\n```\nremaining: 999, 998, 997, 999, 999, 998, 997, 996, 999, 998, 997, 999, 998, 999, 998, ...\nreset:       5,   4,   1,   5,   5,   4,   3,   1,   5,   4,   2,   5,   3,   5,   4, ...\nreset distribution over a ~2s run: {5:9, 4:4, 3:2, 2:2, 1:3}   # 5 distinct reset phases\n```\n\nA single shared fixed-window bucket must show monotonically-decreasing `Remaining` and a single monotonic `Reset` within a window. Five interleaved phases + `Remaining` that climbs back up (997 → 999) indicates ~5 independent backend counters behind a round-robin front.\n\nThe write class shows the same: ~80 write-class POSTs over one connection returned `400` for all 80 with **zero** `429` despite the advertised `50/5s` ceiling.\n\n## Root cause\n\nThe per-IP rate-limit state is not shared across the load-balanced proxy instances (each backend keeps its own counter), so a single client's requests are spread across N independent budgets instead of one.\n\n## Impact\n\nThe effective per-IP budget a single client can consume before `429` is approximately **N× the documented ceiling** (≈5000 reads/5s and 250 writes/5s for ~5 instances). This weakens the only documented anti-abuse control on the public API surface and means a single client can sustain far more volume than the published policy states before the proxy starts shedding it.\n\n## Reproduce\n\n```bash\n# read class\nfor i in $(seq 1 20); do\n  curl -s -o /dev/null -D - https://test.network/api/v1/node \\\n    | grep -iE 'ratelimit-(remaining|reset)'\n  sleep 0.08\ndone\n# observe Remaining climb back up (e.g. 997 -> 999) and Reset bounce across\n# several distinct values within one window\n```\n\n## Severity\n\nMedium — rate-limit abuse / the documented per-IP limit is multiplicatively weaker than stated. (Reinforcement is infra, so re-triage to Low is reasonable if the team treats this as out-of-scope hosting.)","patch_refs":[],"thread":[{"id":12923,"source":"github","source_ref":"7026050818","author":"Joseph Denne","team":true,"body":"Thanks for the report. We have read it and are checking how the hosted proxy counts requests against what you observed. We will update this ticket when there is more to share.","created_at":"2026-11-20T00:15:44+00:00"}]}