{"id":"XE-16484","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":2260,"title":"Inbound sync handler CPU DoS: per-peer cooldown limiter bypassable with unlimited peer IDs; no concurrency cap on inbound sync streams","area":"p2p-sync","claimed_tier":null,"assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-17T01:57:58.655952+00:00","updated_at":"2026-11-22T23:26:14.161827+00:00","source_created_at":null,"told_at":"2026-11-22T23:26:14.193392+00:00","status_changed_at":"2026-11-22T23:26:14.176855+00:00","url":"https://bounty.xe.network/XE-16484","body":"Severity: High (Node/API, DoS)\n\nFile: net/sync.go\n\nThe inbound sync stream handler (net/sync.go:401-408) is only gated by inboundRL.allow(s.Conn().RemotePeer()) — a per-peer cooldown (syncRateLimiter, net/sync.go:62-77). There is no concurrency cap on inbound streams: syncRounds.slots (maxConcurrentSyncRounds=4, net/sync.go:34,88) only limits outbound resync rounds, not inbound handlers. libp2p runs the handler per stream.\n\nAn attacker trivially generates unlimited ed25519 keypairs, so unlimited distinct peer IDs, each bypassing the per-peer cooldown. Each accepted stream runs handleSyncStream (net/sync.go:540) which:\n1. calls frontiersWhereServerIsBehind (net/sync.go:608) over up to maxFrontiers=50000 remote frontiers (net/sync.go:44), and\n2. for each frontier calls ledger.GetBlockHeight (net/sync.go:618 / core/ledger.go:3378) — chainHashes fetches the full account chain and then linearly scans hashes for the target.\n\nCost per request is O(frontiers x chain length). Flooding sync streams from many peer IDs keeps node CPU saturated at ~100% and can stall block processing. Because the limiter map cleanup loop (net/sync.go:67-71) also holds the limiter mutex while iterating every tracked peer, the flood additionally serializes on this mutex.\n\nSuggested fix: add a global inbound sync concurrency cap (semaphore) plus a global token-bucket rate limit independent of peer identity, and bound work per handler (e.g. early-exit after N expensive GetBlockHeight calls, or memoize chain hashes).","patch_refs":[],"thread":[{"id":18832,"source":"desk","source_ref":"reply:16509","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-16484 and says what differs; it is read like any other.","created_at":"2026-11-22T23:26:14.161827+00:00"}]}