{"id":"XE-16983","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"694","source_url":"https://github.com/xeprotocol/xe/issues/694","reporter_id":2920,"title":"[Medium] Ledger sync page decode fails on giant multisig blocks (uncapped signature count)","area":"consensus","claimed_tier":"medium","assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-17T08:13:52.033148+00:00","updated_at":"2026-11-22T23:26:11.319527+00:00","source_created_at":"2026-11-17T08:12:00+00:00","told_at":"2026-11-22T23:26:11.333840+00:00","status_changed_at":"2026-11-22T23:26:11.324740+00:00","url":"https://bounty.xe.network/XE-16983","body":"## Summary\n\nThere is no cap on the number of signatures on a multisig block and no on-chain block size limit for ledger blocks, so a single attacker can create blocks so large that ledger sync breaks: the server serves sync pages count-capped at 256 blocks with no byte cap, and the client decodes each page through a 10 MiB limit — a page of giant blocks fails to decode, the whole round is discarded, and the retry every 10s fails the same way while the giant blocks remain unobtained.\n\n## Root Cause\n\n- **Producer side:** no cap on `len(b.Signatures)` anywhere in the ledger validation path (only `len > 0` checks, `core/ledger.go:1479`, `core/crypto.go:120,158`) and no cap on keyset size in `ValidateKeyset` (`core/multisig.go:35-60`: only non-empty, threshold ≥1, threshold ≤ key count, 64-hex keys, no duplicates). Each `BlockSignature` is ~230 bytes JSON (`core/types.go:58-61`). No on-chain block size limit exists for ledger blocks (unlike statechain's MaxBlockSize).\n- **Consumer side:** server serves sync pages count-capped at 256 blocks/page (`maxPageSize`, `net/sync.go:28`) with NO byte cap; client decodes each page through `io.LimitReader(s, maxSyncResponseBytes=10MB)` (`net/sync.go:40,724-735`) and `requestSync` returns error on decode failure, discarding the whole round (retried every 10s, failing every time while the giant blocks remain unobtained).\n- Blocks up to 1MB are submittable via the official API (`maxRequestBytes = 1<<20`, `api/handler.go:522`); larger ones are addable by an attacker on their own node directly. Gossip caps at 256KB/message (`MaxGossipMessageSize`, `net/gossip.go:27`), so giant blocks propagate only via sync — and then break sync.\n\n## Verification\n\nExecuted PoC (in-package `net` test):\n\n```\ngiant multisig open: signatures=500 jsonBytes=146296 (gossip cap 262144, API cap 1048576)\nsync page: blocks=100 bytes=14629729 maxSyncResponseBytes=10485760\nrequestSync-style decode of giant page: err=unexpected EOF\ncontrol: 1-block page (146326 bytes) decodes OK, blocks=1\n```\n\n## Note on related reports\n\nSearched \"sync page 10MB decode multisig signatures\", \"multisig signature count cap block size\", \"sync page decode fails large block\" — no hits. Distinct from #684 (block_request 64 KiB messenger cap, different protocol/cap) and #670 (verify cost, not size).\n\n## Suggested fix\n\nCap the signature count per block (and/or keyset size) in ledger validation, and add a byte cap to sync pages (serve fewer blocks when they are large) so a page can never exceed what the client can decode.\n","patch_refs":[],"thread":[{"id":18791,"source":"desk","source_ref":"reply:16468","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-16983 and says what differs; it is read like any other.","created_at":"2026-11-22T23:26:11.319527+00:00"}]}