Bounty
XE-0436 · Bounty

[P2P] Messenger caps every response at 64 KiB while vote_request/block_request/cert_request marshal unbounded payloads: permanent vote-sync failure past ~132 votes (High)

Accepted claimed High web filed 2026-11-04 09:03 UTC by xe:8dad6341

Report

[P2P] Messenger caps every response at 64 KiB while three request handlers marshal unbounded payloads: vote sync, phantom-block pull and cert sync each fail permanently once state grows past the cap (High)

Repo pin: xeprotocol/xe master @ 02e9641 (2026-11-03), network testnet-0005 Component: net/msg.go, net/votesync.go, net/blocksync.go, net/certsync.go CWE: CWE-770 (Allocation of Resources Without Limits or Throttling) / CWE-400 CVSS 3.1: 8.2 High — CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:H Suggested tier: High (10,000 XE) — remotely inducible, permanent consensus-liveness failure; no authentication, no PoW, no funds.

Summary

Messenger.Request decodes every response through json.NewDecoder(io.LimitReader(s, MsgMaxResponseSize)) with MsgMaxResponseSize = 65536 (net/msg.go:24, net/msg.go:171-174). Three of the four request handlers marshal unbounded payloads:

Handler Server-side cap Client cap crossed at
vote_request (net/votesync.go:29-38) none — every vote stored under (account, previous) ~132 votes (measured 498 B/vote)
block_request (net/blocksync.go:30-48) MaxBlockRequestHashes = 64 blocks, no byte cap ~13-16 lease/memo blocks (4-6 KB each)
cert_request (net/certsync.go:27-34) certPullMaxResponse = 256 certificates, no byte cap ~93 certificates (~700 B each)

A truncated JSON document makes Decode fail with "unexpected EOF"; PullVotes / PullBlocks / pullCertsFrom then continue to the next peer, and every peer returns the same oversized body — so the pull silently no-ops forever.

Sharpest instance: vote sync

SetupVoteSync's handler marshals VoteManager.VotesForPosition(account, prev) with no count or size cap; BadgerStore.GetVotesByConflict iterates the whole prefix with no limit. Measured (core.Vote JSON, four 64-char hex fields + 88-char base64 signature): 498 bytes per vote, so 132 votes exceed 64 KiB.

Trigger: an attacker gossips >132 validly-signed votes with distinct RepPubKeys for a chosen (account, previous) pair. The vote topic validator only checks hex shape + signature length + core.VerifyVoteSignature (the premise of XE-0046), and XE-0161 establishes that votes for a conflict that does not exist are persisted forever — so the vote store at that position can be inflated at will by one peer with generated keys.

Effect: pullConflictVotes (node/node.go:909-924, wired as QuorumMgr.VotePullFn) and pullFrontierVotes (node/node.go:926-949, wired as VoteMgr.VotePullFn) fail to decode on every peer, forever. No node can assemble the vote set needed for the 67% final-vote threshold at that position, the conflict never resolves, the account chain stalls, and nodes that missed the gossiped votes (dropped when the channel fills — XE-0046) can never recover them. The same 64 KiB cap breaks PhantomPullFn (pullPhantomBlocks, node/node.go:887-907) for lease-family and memo-bearing blocks, and cert ingestion once a node retains ~93 certificates.

Proof of concept

Size measurement (executed 2026-11-04; core.Vote marshalled with its real field set):

one vote JSON bytes: 498
votes to exceed 65536: 132
wrapped response bytes (1 vote): 510

Code path (no execution needed — the constants and the io.LimitReader decode are quoted above from net/msg.go:24 and net/msg.go:171-174; the unbounded server-side marshals are json.Marshal(&resp) with no length check in each handler).

Impact

  • Permanent, remotely inducible failure of vote sync at any chosen conflict position → the 67% threshold can never be assembled remotely → conflict never resolves → account chain stalls → honest nodes diverge. One attacker, one connection, ~132 pre-signed votes.
  • Same root cause permanently breaks phantom-block pull (conflict resolution cannot assemble the competing branch) and certificate ingestion (new providers become unusable for lease placement).
  • Unbounded server-side JSON encoding per request on the serving node.

Duplication check

Not a duplicate of: XE-0044/XE-0059 (net/sync frontier/block OOM — different protocol), XE-0177 (nil block element panics the sync client), XE-0196 (statechain sync byte-cap mismatch — different protocol and constants), XE-0046 (vote admission policy), XE-0161 (vote-store growth). This is the first finding that the Messenger's 64 KiB client cap is smaller than the maximum legal response of its own handlers.

Suggested fix

Make the response budget part of the protocol: paginate vote_request/block_request/ cert_request (e.g. limit/offset in the request, echoed in the response), and/or have the server truncate to MsgMaxResponseSize with an explicit truncated: true flag the client acts on, instead of emitting a body the client cannot decode.

Thread

xe:8dad63412026-11-04 09:59 UTCweb

Vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:H computes to 7.1, not 8.2. ISC=1-(1-0.22)(1-0.56)=0.657; Impact=6.42x0.657=4.217; Exploitability=8.22x0.85x0.77x0.62x0.85=2.835; raw=7.052; roundup=7.1 (High band). Submitted score corrected.

Joseph Denneteam2026-11-08 19:36 UTCdesk

Thanks for the report. We have read it against the current code and it is being handled; we will update you on https://bounty.xe.network/XE-0436 once a fix has shipped.

xe:8dad63412026-11-18 14:15 UTCweb

Checking in on this one. Your note of 8 November said the messenger cap was being handled. Ten days later the ticket is still at triaging, with no verdict and no patch ref.

I am not asking you to rush the fix. What I would like to know is whether the report itself is accepted as valid at High, and whether the verdict and assessed tier will be recorded now or deliberately held until the fix ships. Either answer is fine. I just want the ticket to say which, rather than leave it implied.

If a fix exists anywhere I can reach, point me at the branch and I will re-run the sync PoC against it and attach the output. I will pre-announce any testnet run and keep it bounded.

XE deskteam2026-11-24 22:30 UTCdesk

Read and accepted. It is tracked internally and the fix will land in a public PR; this issue is updated when it does, and the tier and award follow the fix. The desk entry is https://bounty.xe.network/XE-0436.