<!-- XE-16983 · [Medium] Ledger sync page decode fails on giant multisig blocks (uncapped signature count) · testnet -->
*Markdown view of <https://bounty.xe.network/XE-16983>. The page is the record; this is the same page for reading.*

XE-16983 · Bounty

# \[Medium\] Ledger sync page decode fails on giant multisig blocks (uncapped signature count)

Closed · duplicate
—claimed Medium
[xe#694](https://github.com/xeprotocol/xe/issues/694)
filed 2026-11-17 08:12 UTC
by kecedanzz77-bit

Verdict
:   Duplicate

Tier
:   —

Claimed
:   Medium

Area
:   Consensus

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-22 23:26 UTC

Told
:   2026-11-22 23:26 UTC

### Patches

None linked.

### History

- [769968](https://bounty.xe.network/log/769968) 2026-11-22 23:26 UTC reply.mirror\_failed
- [769803](https://bounty.xe.network/log/769803) 2026-11-22 23:26 UTC proposal.adopted
- [769802](https://bounty.xe.network/log/769802) 2026-11-22 23:26 UTC reply.sent
- [769801](https://bounty.xe.network/log/769801) 2026-11-22 23:26 UTC ticket.status new → closed
- [768723](https://bounty.xe.network/log/768723) 2026-11-22 23:25 UTC proposal.adopted
- [768722](https://bounty.xe.network/log/768722) 2026-11-22 23:25 UTC ticket.facts area
- [768721](https://bounty.xe.network/log/768721) 2026-11-22 23:25 UTC proposal.adopted
- [768720](https://bounty.xe.network/log/768720) 2026-11-22 23:25 UTC ticket.facts
- [768719](https://bounty.xe.network/log/768719) 2026-11-22 23:25 UTC proposal.adopted
- [768718](https://bounty.xe.network/log/768718) 2026-11-22 23:25 UTC ticket.facts
- [766720](https://bounty.xe.network/log/766720) 2026-11-22 23:18 UTC note.added
- [766719](https://bounty.xe.network/log/766719) 2026-11-22 23:18 UTC proposal.created

[Full history](https://bounty.xe.network/log?ref=XE-16983) · [JSON](https://bounty.xe.network/v1/tickets/XE-16983) · [markdown](https://bounty.xe.network/XE-16983.md)

### Report

## Summary

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

## Root Cause

- **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).
- **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).
- 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.

## Verification

Executed PoC (in-package `net` test):

```
giant multisig open: signatures=500 jsonBytes=146296 (gossip cap 262144, API cap 1048576)
sync page: blocks=100 bytes=14629729 maxSyncResponseBytes=10485760
requestSync-style decode of giant page: err=unexpected EOF
control: 1-block page (146326 bytes) decodes OK, blocks=1
```

## Note on related reports

Searched "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).

## Suggested fix

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

### Thread

**Joseph Denne**team2026-11-22 23:26 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-16983 and says what differs; it is read like any other.
