<!-- XE-1134 · [HIGH] net: Gossip.Subscribe requires len(b.Signature) == 128 and silently drops 100% of multisig blocks across the network · testnet -->
*Markdown view of <https://bounty.xe.network/XE-1134>. The page is the record; this is the same page for reading.*

XE-1134 · Bounty

# \[HIGH\] net: Gossip.Subscribe requires len(b.Signature) \=\= 128 and silently drops 100% of multisig blocks across the network

Closed · duplicate
—claimed High
[xe#291](https://github.com/xeprotocol/xe/issues/291)
filed 2026-11-07 16:35 UTC
by pa-khan

Verdict
:   Duplicate

Tier
:   —

Claimed
:   High

Area
:   P2P / sync

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-14 22:55 UTC

Told
:   2026-11-14 22:53 UTC

### Patches

- [xe#292](https://github.com/xeprotocol/xe/pull/292) open by pa-khan
  fix(net): deliver multisig blocks in Gossip.Subscribe and validate block signature fields
- [xe#295](https://github.com/xeprotocol/xe/pull/295) open by tipprb
  fix(net): deliver multisig blocks in Gossip.Subscribe and validate block signature fields

### History

- [209918](https://bounty.xe.network/log/209918) 2026-11-14 22:53 UTC reply.mirrored
- [209900](https://bounty.xe.network/log/209900) 2026-11-14 22:53 UTC reply.sent
- [45027](https://bounty.xe.network/log/45027) 2026-11-08 20:32 UTC github.state\_pushed
- [45026](https://bounty.xe.network/log/45026) 2026-11-08 20:32 UTC github.labels
- [44640](https://bounty.xe.network/log/44640) 2026-11-08 20:32 UTC proposal.adopted
- [44639](https://bounty.xe.network/log/44639) 2026-11-08 20:32 UTC ticket.status new → closed
- [31062](https://bounty.xe.network/log/31062) 2026-11-08 11:43 UTC proposal.adopted
- [31061](https://bounty.xe.network/log/31061) 2026-11-08 11:43 UTC ticket.facts area
- [31060](https://bounty.xe.network/log/31060) 2026-11-08 11:43 UTC proposal.adopted
- [31059](https://bounty.xe.network/log/31059) 2026-11-08 11:43 UTC ticket.facts
- [31058](https://bounty.xe.network/log/31058) 2026-11-08 11:43 UTC proposal.adopted
- [31057](https://bounty.xe.network/log/31057) 2026-11-08 11:43 UTC ticket.facts

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

### Report

## Summary

Every multisig block in XE (`multisig_open`, `multisig_update`, and any `send`, `receive`, `lease`, `lease_accept`, `lease_settle`, `lease_cancel`, `lease_force_settle`, `lease_renew`, `burn`, or `mint` signed by a multisig account) carries an empty single-key `Signature` field (`b.Signature == ""`) and stores its credentials in `b.Signatures []core.BlockSignature`.

While the GossipSub topic validator `blockValidator` (`net/gossip_validate.go:77`) was updated to accept multisig blocks (`if len(b.Signature) != 128 && len(b.Signatures) == 0`), the subscriber loop `Gossip.Subscribe` (`net/gossip.go:150`) still enforces `len(b.Signature) != 128`:

```
b := bm.Block
if len(b.Hash) != 64 || len(b.Signature) != 128 || len(b.Account) != 64 {
    continue
}
```

Because `len(b.Signature) == 0` on every valid multisig block (and `core.ValidatePubKeyDeclaration` / `core.VerifyBlock` treat `len(b.Signatures) > 0` as the multisig credential path), `Gossip.Subscribe` silently drops **100% of multisig blocks** on every subscribing node in the network immediately after `blockValidator` accepts and forwards them across the GossipSub mesh.

In addition, `blockValidator` (`net/gossip_validate.go:77`) only checks `len(b.Signature) != 128 && len(b.Signatures) == 0` without enforcing mutual exclusion between `b.Signature` and `b.Signatures`, without bounding `len(b.Signatures)` to the 256-key canonical keyset cap (`unmarshalKeysetCanonical` in `core/encoding.go:567`), and without validating that each `core.BlockSignature` entry has a 64-character hex `PublicKey`, a 128-character hex `Sig`, and unique signers.

## Affected Code

- `net/gossip.go` (`Gossip.Subscribe`, lines 149–152):

  ```
  b := bm.Block
  if len(b.Hash) != 64 || len(b.Signature) != 128 || len(b.Account) != 64 {
      continue
  }
  ```
- `net/gossip_validate.go` (`blockValidator`, lines 73–79):

  ```
  if !isHex64(b.Hash) || !isHex64(b.Account) {
      return pubsub.ValidationReject
  }

  if len(b.Signature) != 128 && len(b.Signatures) == 0 {
      return pubsub.ValidationReject
  }
  ```
- `node/node.go` (`Node.handleIncoming`, lines 570, 705–739):
  `n.handleIncoming(gossip.Subscribe(ctx))` is the sole entry point for live gossip block ingestion, provider lease auto-acceptance (`n.autoAcceptLease(b)` at line 721), and consumer VM credential scrubbing on `lease_settle` (lines 729–737).

## Root Cause \& Impact

1. **100% Gossip Drop of All Multisig Blocks**:

   - When a node accepts a multisig block via `SubmitBlock` (`node/node.go:1282`) and calls `n.Gossip.Publish(n.ctx, b)`, GossipSub's `blockValidator` returns `pubsub.ValidationAccept`, but every peer's `Gossip.Subscribe` loop hits `len(b.Signature) != 128` (`0 != 128`) and executes `continue`.
   - No peer or representative ever receives any multisig block over the `xe/blocks` gossip topic.
2. **Provider `autoAcceptLease` \& VM Provisioning Never Trigger for Multisig Consumers (Escrow Lockup)**:

   - In `node/node.go:721`, provider auto-acceptance (`n.autoAcceptLease(b)`) is triggered **exclusively** inside `handleIncoming(gossip.Subscribe(ctx))` and is never invoked when blocks arrive later via `/xe/sync/1.0.0` (`Ledger.AddSyncedBlock`).
   - Consequently, any `lease` block submitted by a multisig consumer account is dropped by `Gossip.Subscribe` on the provider node, so the provider never auto-accepts the lease or provisions the VM, leaving the multisig consumer's XUSD locked in escrow until expiration.
   - Similarly, a `lease_settle` block from a multisig provider never reaches `handleIncoming` (`node/node.go:729`) on the consumer node to mark the VM `"stopped"` and scrub cached credentials.
3. **Delayed/Suppressed Fork Detection on Conflicting Multisig Blocks**:

   - If two conflicting multisig blocks at the same `(Account, Previous)` are submitted to different nodes, neither block is delivered over `xe/blocks` gossip. During `/xe/sync/1.0.0`, `findMissingBlocksPaginated` (`net/sync.go:714`) treats the peer's divergent frontier as unrecognized rather than staging a conflict until multiple consecutive sync rejections elapse.
4. **Unvalidated `b.Signatures` Entries \& Hybrid `Signature`\+`Signatures` Bypass in `blockValidator`**:

   - Because `b.Signature` and `b.Signatures` are excluded from `core.HashBlock(b)` (and PoW), `blockValidator` accepts hybrid blocks carrying both `b.Signature` and `b.Signatures`, blocks with \>256 multisig signature entries, duplicate signers, or entries with short/non-hex `PublicKey` (`len(sig.PublicKey) < 64`, which triggers an unbounds-checked `pk[:12]` slice panic in `core.VerifyMultisig` at `core/multisig.go:94,99,103`).

## Reproduction (Failing Pre-Fix Test)

Run `go test -race -v ./net -run 'TestGossipSubscribeDeliversMultisigBlocks|TestBlockValidatorMultisigAndMalformedSignatures'`:

```
=== RUN   TestGossipSubscribeDeliversMultisigBlocks
    gossip_multisig_test.go:131: Gossip.Subscribe silently dropped valid multisig block c0a006a9080f (Signature="", len(Signatures)=2)
--- FAIL: TestGossipSubscribeDeliversMultisigBlocks (2.10s)
=== RUN   TestBlockValidatorMultisigAndMalformedSignatures
    gossip_multisig_test.go:158: hybrid Signature+Signatures block: got 0, want ValidationReject
--- FAIL: TestBlockValidatorMultisigAndMalformedSignatures (0.00s)
FAIL
FAIL	github.com/xeprotocol/xe/net	2.129s
```

## Proposed Fix

1. Introduce `hasValidBlockSignatures(b *core.Block) bool` in `net/gossip_validate.go` that enforces:
   - Mutual exclusion between single-key `b.Signature != ""` and multisig `len(b.Signatures) > 0` (`hasSingle != hasMulti`).
   - `isHex128(b.Signature)` when `b.Signature != ""`.
   - `1 <= len(b.Signatures) <= maxMultisigSignatures` (`256`), `isHex64(sig.PublicKey)`, `isHex128(sig.Sig)`, and case-insensitive uniqueness of `sig.PublicKey` across `b.Signatures`.
2. Use `!isHex64(b.Hash) || !isHex64(b.Account) || !hasValidBlockSignatures(b)` in both `blockValidator` (`net/gossip_validate.go`) and `Gossip.Subscribe` (`net/gossip.go`).

---

**Payout / Reward Address (Base / EVM / XE)**: `0x45Ecf534fD00bb3179D34E6a3FDdE084cBfBc9Fb`

### Thread

**XE desk**team2026-11-14 22:53 UTCgithub

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-1134 and says what differs; it is read like any other.
