[HIGH] net: Gossip.Subscribe requires len(b.Signature) == 128 and silently drops 100% of multisig blocks across the network
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 onlease_settle(lines 729–737).
Root Cause & Impact
-
100% Gossip Drop of All Multisig Blocks:
- When a node accepts a multisig block via
SubmitBlock(node/node.go:1282) and callsn.Gossip.Publish(n.ctx, b), GossipSub'sblockValidatorreturnspubsub.ValidationAccept, but every peer'sGossip.Subscribeloop hitslen(b.Signature) != 128(0 != 128) and executescontinue. - No peer or representative ever receives any multisig block over the
xe/blocksgossip topic.
- When a node accepts a multisig block via
-
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 insidehandleIncoming(gossip.Subscribe(ctx))and is never invoked when blocks arrive later via/xe/sync/1.0.0(Ledger.AddSyncedBlock). - Consequently, any
leaseblock submitted by a multisig consumer account is dropped byGossip.Subscribeon 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_settleblock from a multisig provider never reacheshandleIncoming(node/node.go:729) on the consumer node to mark the VM"stopped"and scrub cached credentials.
- In
-
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 overxe/blocksgossip. 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.
- If two conflicting multisig blocks at the same
-
Unvalidated
b.SignaturesEntries & HybridSignature+SignaturesBypass inblockValidator:- Because
b.Signatureandb.Signaturesare excluded fromcore.HashBlock(b)(and PoW),blockValidatoraccepts hybrid blocks carrying bothb.Signatureandb.Signatures, blocks with >256 multisig signature entries, duplicate signers, or entries with short/non-hexPublicKey(len(sig.PublicKey) < 64, which triggers an unbounds-checkedpk[:12]slice panic incore.VerifyMultisigatcore/multisig.go:94,99,103).
- Because
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
- Introduce
hasValidBlockSignatures(b *core.Block) boolinnet/gossip_validate.gothat enforces:- Mutual exclusion between single-key
b.Signature != ""and multisiglen(b.Signatures) > 0(hasSingle != hasMulti). isHex128(b.Signature)whenb.Signature != "".1 <= len(b.Signatures) <= maxMultisigSignatures(256),isHex64(sig.PublicKey),isHex128(sig.Sig), and case-insensitive uniqueness ofsig.PublicKeyacrossb.Signatures.
- Mutual exclusion between single-key
- Use
!isHex64(b.Hash) || !isHex64(b.Account) || !hasValidBlockSignatures(b)in bothblockValidator(net/gossip_validate.go) andGossip.Subscribe(net/gossip.go).
Payout / Reward Address (Base / EVM / XE): 0x45Ecf534fD00bb3179D34E6a3FDdE084cBfBc9Fb
Thread
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.