<!-- XE-16992 · [Low] MarshalBlock accepts a multisig block with an empty keyset that UnmarshalBlock rejects · testnet -->
*Markdown view of <https://bounty.xe.network/XE-16992>. The page is the record; this is the same page for reading.*

XE-16992 · Bounty

# \[Low\] MarshalBlock accepts a multisig block with an empty keyset that UnmarshalBlock rejects

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

Verdict
:   Invalid

Tier
:   —

Claimed
:   —

Area
:   Consensus

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-22 23:42 UTC

Told
:   2026-11-22 23:42 UTC

### Patches

None linked.

### History

- [770724](https://bounty.xe.network/log/770724) 2026-11-22 23:42 UTC reply.mirror\_failed
- [770608](https://bounty.xe.network/log/770608) 2026-11-22 23:42 UTC reply.sent
- [770239](https://bounty.xe.network/log/770239) 2026-11-22 23:26 UTC proposal.adopted
- [769952](https://bounty.xe.network/log/769952) 2026-11-22 23:26 UTC proposal.adopted
- [769951](https://bounty.xe.network/log/769951) 2026-11-22 23:26 UTC ticket.status new → closed
- [768989](https://bounty.xe.network/log/768989) 2026-11-22 23:25 UTC proposal.adopted
- [768988](https://bounty.xe.network/log/768988) 2026-11-22 23:25 UTC ticket.facts area
- [768987](https://bounty.xe.network/log/768987) 2026-11-22 23:25 UTC proposal.adopted
- [768986](https://bounty.xe.network/log/768986) 2026-11-22 23:25 UTC ticket.facts
- [766443](https://bounty.xe.network/log/766443) 2026-11-22 23:17 UTC note.added
- [766434](https://bounty.xe.network/log/766434) 2026-11-22 23:17 UTC proposal.created
- [766433](https://bounty.xe.network/log/766433) 2026-11-22 23:17 UTC proposal.created

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

### Report

## Summary

`MarshalBlock` accepts a multisig block with an empty keyset that `UnmarshalBlock` rejects — the codec produces bytes it cannot read back. Same class as #84, different mechanism (keyset validation asymmetry, not a missing type case). Latent (the binary codec has no callers outside `encoding.go` \+ `crypto.go`), same standing as accepted #100.

## Root Cause

- `marshalKeysetCanonical` (`core/encoding.go:549`) has no key-count check (only a nil check).
- `unmarshalKeysetCanonical` (`:580-581`) rejects `numKeys < 1`.

## Verification

Executed PoC:

```
MarshalBlock(empty keyset): err=<nil> bytes=138
UnmarshalBlock(that output): err=UnmarshalBlock: keyset: invalid key count: 0
Control 2-key keyset: marshal err=<nil> unmarshal err=<nil> keys=2 threshold=2
```

## Note on related reports

Read #84's full body (missing `lease_renew` decode case, now fixed on HEAD) — different mechanism. Searched `keyset empty zero keys unmarshal` — no hits.

## Suggested fix

Reject empty keysets in `marshalKeysetCanonical`, matching the decoder.

### Thread

**XE desk**team2026-11-22 23:42 UTCdesk

Thanks for the report. We read it against the code and could not confirm a bug in what it describes.

This report is closed as invalid. If we have missed something, file a new report that links
https://bounty.xe.network/XE-16992 and says what; it is read like any other.
