<!-- XE-16841 · [Low] VerifyMultisig verifies every attached signature with no early exit and no cap · testnet -->
*Markdown view of <https://bounty.xe.network/XE-16841>. The page is the record; this is the same page for reading.*

XE-16841 · Bounty

# \[Low\] VerifyMultisig verifies every attached signature with no early exit and no cap

Closed · duplicate
—
[xe#670](https://github.com/xeprotocol/xe/issues/670)
filed 2026-11-17 06:32 UTC
by kecedanzz77-bit

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   Consensus

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-22 23:26 UTC

Told
:   2026-11-22 23:26 UTC

### Patches

None linked.

### History

- [770250](https://bounty.xe.network/log/770250) 2026-11-22 23:26 UTC reply.mirror\_failed
- [769856](https://bounty.xe.network/log/769856) 2026-11-22 23:26 UTC proposal.adopted
- [769855](https://bounty.xe.network/log/769855) 2026-11-22 23:26 UTC reply.sent
- [769854](https://bounty.xe.network/log/769854) 2026-11-22 23:26 UTC proposal.adopted
- [769853](https://bounty.xe.network/log/769853) 2026-11-22 23:26 UTC ticket.status new → closed
- [768813](https://bounty.xe.network/log/768813) 2026-11-22 23:25 UTC proposal.adopted
- [768812](https://bounty.xe.network/log/768812) 2026-11-22 23:25 UTC ticket.facts area
- [768811](https://bounty.xe.network/log/768811) 2026-11-22 23:25 UTC proposal.adopted
- [768810](https://bounty.xe.network/log/768810) 2026-11-22 23:25 UTC ticket.facts
- [768809](https://bounty.xe.network/log/768809) 2026-11-22 23:25 UTC proposal.adopted
- [768808](https://bounty.xe.network/log/768808) 2026-11-22 23:25 UTC ticket.facts
- [766634](https://bounty.xe.network/log/766634) 2026-11-22 23:17 UTC note.added

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

### Report

## Summary

`VerifyMultisig` verifies every attached signature even after the threshold is already met, and nothing caps how many signatures a block may carry. A block with \~1,200 signatures costs each verifying node \~200 ms of CPU per `AddBlock` (verification runs twice), vs \~0.24 ms for a normal 2-signature block.

## Root cause

`VerifyMultisig` (`core/multisig.go:73-117`) verifies all signatures in the loop and only checks `validCount < ks.Threshold` afterwards — no break once the threshold is met, unlike `VerifyMultisigAny` (`:119-144`) which returns on the first valid sig. Nothing caps the signature count anywhere (`addBlock`, gossip validator, API) — only the 256 KiB gossip / 1 MiB API message limits bound it (\~1,200 sigs fit in a gossip message).

## Verification

Measured benchmark (1,200 valid sigs, threshold 2): attacker signing cost \~44-70 ms, victim `VerifyMultisig` cost \~99-130 ms per call — and verification runs twice per `AddBlock` (once in `addBlock` `:856`, once in `dispatchValidateAndAdd` `:979`), so \~200 ms victim CPU per block per node (\~4.5x per-node amplification, plus gossip fan-out). 2-sig baseline: \~231-238 µs. Early exit is safe: signatures are not part of the block hash, so an extra unvalidated signature is inert.

Caveat, stated honestly: modest impact — requires an attacker-owned large keyset and roughly symmetric signing cost; the amplification is mostly the double verification \+ fan-out.

## Note on related reports

No existing report covers this. Searched `VerifyMultisig threshold signatures`, `too many signatures multisig`, `signature verification DoS`, `unbounded signatures`. #609 (malformed signer pubkey crash), #506/#614 (lease ops need 1 sig), #394/#552 (gossip drops multisig) are different issues.

## Suggested fix

Break out of the loop once `validCount == ks.Threshold` (and/or cap attached signatures, e.g. at keyset size).

### Thread

**Joseph Denne**team2026-11-22 23:26 UTCdesk

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