Bounty
XE-10141 · Bounty

Consensus Sync Goroutine Amplification: pullConflictVotes lacks concurrency semaphore causing network socket and goroutine explosion

Closed · duplicate — web filed 2026-11-12 10:15 UTC by xe:e4cd6974

Report

Vulnerability Summary

In node/node.go:909-924, pullConflictVotes is wired to QuorumManager.VotePullFn to synchronize votes for unresolved consensus conflicts:

func (n *Node) pullConflictVotes(account, previous string) {
	if account == "" {
		return
	}
	n.wg.Add(1)
	go func() {
		defer n.wg.Done()
		peers := n.Host.Network().Peers()
		if len(peers) == 0 {
			return
		}
		if xenet.PullVotes(n.ctx, n.Msg, peers, account, previous, n.VoteMgr.ReceiveVote) > 0 {
			n.syncTracker.MarkDirty()
		}
	}()
}

Compare this with pullFrontierVotes (lines 926-949) which strictly guards concurrency using a bounded semaphore channel:

	select {
	case n.pullSem <- struct{}{}:
	default:
		return false
	}

In pullConflictVotes:

  1. Zero Concurrency Limit: No semaphore channel or rate limiter guards execution.
  2. High Execution Latency: xenet.PullVotes (net/votesync.go:40-66) loops through all connected peers sequentially:
    for _, pid := range peers {
        reqCtx, cancel := context.WithTimeout(ctx, votePullTimeout) // 10s per peer
        raw, err := msg.Request(reqCtx, pid, VoteRequestMsgType, ...)
    
    For a node connected to 30-50 peers, a single PullVotes execution can block for several minutes.
  3. 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.

When 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.

Proposed Remediation

Apply bounded concurrency to pullConflictVotes using the existing n.pullSem or a dedicated conflict pull semaphore:

func (n *Node) pullConflictVotes(account, previous string) {
	if account == "" {
		return
	}
	select {
	case n.pullSem <- struct{}{}:
	default:
		return // Do not spawn goroutine if worker pool is saturated
	}
	n.wg.Add(1)
	go func() {
		defer n.wg.Done()
		defer func() { <-n.pullSem }()
		...
	}()
}

Thread

Joseph Denneteam2026-11-20 00:33 UTCdesk

Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-10141 and says what differs; it is read like any other.