CVE-2026-58262 — Klever Go counts bitmap padding bits toward BLS quorum, allowing blocks with insufficient signatures

## Summary When validating an incoming block header, `HeaderSigVerifier.verifyConsensusSize` counts *every* set bit in `PubKeysBitmap` — including bits that correspond to no validator (the padding bits of the final byte, which exist whenever the consensus group size is not a multiple of 8). The subsequent BLS aggregate-signature verification (`blsMultiSigner.Verify`) only checks signature validity for real validator indices and silently ignores those padding bits. As a result, a malicious or compromised block producer can set the padding bits to make the on-bits reach the PBFT quorum while only gathering a smaller number of real validator signature shares, causing a block to be accepted as correctly signed without a genuine two-thirds validator quorum. ## Details Quorum counter counts padding bits — `core/process/headerCheck/headerSignatureVerify.go:145-183`: ```go func (hsv *HeaderSigVerifier) verifyConsensusSize(consensusPubKeys []string, header data.HeaderHandler) error { consensusSize := len(consensusPubKeys) bitmap := header.GetPubKeysBitmap() expectedBitmapSize := consensusSize / 8 if consensusSize%8 != 0 { expectedBitmapSize++ } if len(bitmap) != expectedBitmapSize { ... return ErrWrongSizeBitmap } numOfOnesInBitmap := 0 for index := range bitmap { numOfOnesInBitmap += bits.OnesCount8(bitmap[index]) // = minNumRequiredSignatures { return nil } ... return ErrNotEnoughSignatures } ``` The bitmap-byte-length check above only ensures the byte array is the right *size*; it never requires the padding bits (bits `[consensusSize … expectedBitmapSize*8)`) to be zero. So any combination of padding bits is accepted toward the quorum. `VerifySignature` (`:92-143`) then builds the verifier from the *real* public keys, sets the aggregate signature, and calls `verifier.Verify(hash, bitmap)`. The BLS verifier ignores padding bits — `crypto/signing/multisig/blsMultisig.go:272-297`: ```go func (bms *blsMultiSigner) Verify(message []byte, bitmap []byte) error { ... maxFlags := len(bitmap) * 8 flagsMismatch := maxFlags < len(bms.data.pubKeys) // only rejects *too few* bytes if flagsMismatch { return crypto.ErrBitmapMismatch } pubKeys := make([]crypto.PublicKey, 0) for i := range bms.data.pubKeys { // = len(pubKeys)` is never inspected by `isIndexInBitmap` and is therefore silently dropped from signature verification, even though `verifyConsensusSize` already counted it toward quorum. PBFT threshold — `core/consensus/consensus.go:5-8` (`consensusSize*2/3 + 1`) and fallback `:10-13` (`consensusSize/2 + 1`). Reachable from received blocks — `core/process/block/interceptedBlocks/interceptedBlock.go:181-201` runs `CheckValidity()` → `VerifySignature` on every header received from peers. ### Worked example (consensus size = 5) - Required PBFT quorum: `5*2/3 + 1 = 4`. - Valid validator bit positions: 0..4. Bits 5, 6, 7 are padding (no validator). - Attacker gathers only **one** real signature share (validator 0) and aggregates it. - Sets bitmap byte to `0b1110_0001` (`0xE1`): bit 0 (real) + bits 5, 6, 7 (padding). - `verifyConsensusSize` sees `bits.OnesCount8(0xE1) = 4` ≥ 4 → passes quorum. - `blsMultiSigner.Verify` only validates against validator 0's public key (padding ignored) → passes. - The block is accepted with one real signer instead of four. For any `consensusSize` not divisible by 8, up to `8 - (consensusSize % 8)` fake "padding" signatures can be counted toward quorum. On a 21-member group (one padding bit) the attacker shaves one vote; on smaller/sharded groups with `consensusSize % 8` close to 7 the relative impact is larger. ## PoC Reproduced locally against current `develop` (`085a5d1`) with this test (run under `core/process/headerCheck`, removed after verification): ```go func TestPOCHeaderSigVerifierCountsPaddingBitsTowardQuorum(t *testing.T) { args := createHeaderSigVerifierArgs() args.NodesCoordinator = &cMock.NodesCoordinatorMock{ GetValidatorsPublicKeysCalled: func(_ []byte, _ uint64, _ uint32) ([]string, error) { return []

Published

Reported versions and fixes

  • Source-reported product — Reported version range < 1.7.20 — Fixed in 1.7.20

Source evidence