Bounty
XE-16992 · Bounty

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

Closed · invalid — xe#703 filed 2026-11-17 08:12 UTC by kecedanzz77-bit

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