{"id":"XE-10141","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":730,"title":"Consensus Sync Goroutine Amplification: pullConflictVotes lacks concurrency semaphore causing network socket and goroutine explosion","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-12T10:15:45.056539+00:00","updated_at":"2026-11-20T00:33:19.980310+00:00","source_created_at":null,"told_at":"2026-11-20T00:33:19.994806+00:00","status_changed_at":"2026-11-20T00:33:19.986307+00:00","url":"https://bounty.xe.network/XE-10141","body":"## Vulnerability Summary\n\nIn `node/node.go:909-924`, `pullConflictVotes` is wired to `QuorumManager.VotePullFn` to synchronize votes for unresolved consensus conflicts:\n\n```go\nfunc (n *Node) pullConflictVotes(account, previous string) {\n\tif account == \"\" {\n\t\treturn\n\t}\n\tn.wg.Add(1)\n\tgo func() {\n\t\tdefer n.wg.Done()\n\t\tpeers := n.Host.Network().Peers()\n\t\tif len(peers) == 0 {\n\t\t\treturn\n\t\t}\n\t\tif xenet.PullVotes(n.ctx, n.Msg, peers, account, previous, n.VoteMgr.ReceiveVote) > 0 {\n\t\t\tn.syncTracker.MarkDirty()\n\t\t}\n\t}()\n}\n```\n\nCompare this with `pullFrontierVotes` (lines 926-949) which strictly guards concurrency using a bounded semaphore channel:\n```go\n\tselect {\n\tcase n.pullSem <- struct{}{}:\n\tdefault:\n\t\treturn false\n\t}\n```\n\nIn `pullConflictVotes`:\n1. Zero Concurrency Limit: No semaphore channel or rate limiter guards execution.\n2. High Execution Latency: `xenet.PullVotes` (`net/votesync.go:40-66`) loops through all connected peers sequentially:\n   ```go\n   for _, pid := range peers {\n       reqCtx, cancel := context.WithTimeout(ctx, votePullTimeout) // 10s per peer\n       raw, err := msg.Request(reqCtx, pid, VoteRequestMsgType, ...)\n   ```\n   For a node connected to 30-50 peers, a single `PullVotes` execution can block for several minutes.\n3. Rapid Invocation from Sweep Loop: In `core/quorum.go:570-573`, `sweepOpenConflicts()` invokes `VotePullFn` on every sweep interval for each open conflict in the store.\n\nWhen an attacker introduces multiple concurrent conflict forks or network partitions cause unresolved conflicts, `pullConflictVotes` spawns hundreds of concurrent long-lived goroutines. Each goroutine opens sequential libp2p streams to every peer in the network, creating massive P2P connection amplification, socket exhaustion (`EMFILE`), and node memory starvation.\n\n## Proposed Remediation\n\nApply bounded concurrency to `pullConflictVotes` using the existing `n.pullSem` or a dedicated conflict pull semaphore:\n```go\nfunc (n *Node) pullConflictVotes(account, previous string) {\n\tif account == \"\" {\n\t\treturn\n\t}\n\tselect {\n\tcase n.pullSem <- struct{}{}:\n\tdefault:\n\t\treturn // Do not spawn goroutine if worker pool is saturated\n\t}\n\tn.wg.Add(1)\n\tgo func() {\n\t\tdefer n.wg.Done()\n\t\tdefer func() { <-n.pullSem }()\n\t\t...\n\t}()\n}\n```","patch_refs":[],"thread":[{"id":13241,"source":"desk","source_ref":"reply:11263","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-10141 and says what differs; it is read like any other.","created_at":"2026-11-20T00:33:19.980310+00:00"}]}