{"id":"XE-16992","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"703","source_url":"https://github.com/xeprotocol/xe/issues/703","reporter_id":2920,"title":"[Low] MarshalBlock accepts a multisig block with an empty keyset that UnmarshalBlock rejects","area":"consensus","claimed_tier":null,"assessed_tier":null,"verdict":"invalid","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"invalid","github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-17T08:13:52.208552+00:00","updated_at":"2026-11-22T23:42:11.101458+00:00","source_created_at":"2026-11-17T08:12:58+00:00","told_at":"2026-11-22T23:42:11.102862+00:00","status_changed_at":"2026-11-22T23:26:14.245711+00:00","url":"https://bounty.xe.network/XE-16992","body":"## Summary\n\n`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.\n\n## Root Cause\n\n- `marshalKeysetCanonical` (`core/encoding.go:549`) has no key-count check (only a nil check).\n- `unmarshalKeysetCanonical` (`:580-581`) rejects `numKeys < 1`.\n\n## Verification\n\nExecuted PoC:\n\n```\nMarshalBlock(empty keyset): err=<nil> bytes=138\nUnmarshalBlock(that output): err=UnmarshalBlock: keyset: invalid key count: 0\nControl 2-key keyset: marshal err=<nil> unmarshal err=<nil> keys=2 threshold=2\n```\n\n## Note on related reports\n\nRead #84's full body (missing `lease_renew` decode case, now fixed on HEAD) — different mechanism. Searched `keyset empty zero keys unmarshal` — no hits.\n\n## Suggested fix\n\nReject empty keysets in `marshalKeysetCanonical`, matching the decoder.\n","patch_refs":[],"thread":[{"id":18930,"source":"desk","source_ref":"reply:16607","author":"XE desk","team":true,"body":"Thanks for the report. We read it against the code and could not confirm a bug in what it describes.\n\nThis report is closed as invalid. If we have missed something, file a new report that links\nhttps://bounty.xe.network/XE-16992 and says what; it is read like any other.","created_at":"2026-11-22T23:42:11.101458+00:00"}]}