BLS related fixes based on Certik audit#822
Open
libermans wants to merge 12 commits intoupgrade-v0.2.11from
Open
BLS related fixes based on Certik audit#822libermans wants to merge 12 commits intoupgrade-v0.2.11from
libermans wants to merge 12 commits intoupgrade-v0.2.11from
Conversation
…ubmitDealerPart.ValidateBasic()`
…gSubmitGroupKeyValidationSignature.ValidateBasic()`
…ubmissions Reject malformed partial signature payloads and oversized verification vectors at message validation time so invalid inputs are dropped before keeper processing and cannot trigger unnecessary DKG work. Made-with: Cursor
|
Reviewed all 11 Certik audit findings. Fixes look correct and well-structured — each commit maps cleanly to an audit finding, implementations are sound, and test coverage is solid. A couple of minor non-blocking observations:
LGTM overall. |
GLiberman
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BLS Audit Fixes Included in This PR
The following security findings from Certik bridge audit have been resolved in this PR:
inference-chain/x/bls/types/message_submit_partial_signature.goinference-chain/x/bls/types/validate_basic_test.goinference-chain/x/bls/keeper/msg_server_group_validation.goinference-chain/x/bls/keeper/msg_server_group_validation_timing_test.goinference-chain/x/bls/keeper/threshold_signing.godecentralized-api/internal/bls/verifier.goinference-chain/x/bls/keeper/msg_server_dealer.goinference-chain/x/bls/keeper/msg_server_dealer_test.goinference-chain/x/bls/keeper/bls_crypto.goinference-chain/x/bls/keeper/bls_crypto_aggregation_test.goinference-chain/x/bls/keeper/phase_transitions.goinference-chain/x/bls/keeper/phase_transitions_test.goinference-chain/x/bls/keeper/dkg_initiation.goinference-chain/x/bls/keeper/dkg_initiation_internal_test.gologging.Debugdecentralized-api/internal/bls/verifier.goMsgRequestThresholdSignature.ValidateBasic()inference-chain/x/bls/types/message_request_threshold_signature.goinference-chain/x/bls/types/validate_basic_test.goMsgSubmitDealerPart.ValidateBasic()inference-chain/x/bls/types/message_submit_dealer_part.goinference-chain/x/bls/types/validate_basic_test.goMsgSubmitGroupKeyValidationSignature.ValidateBasic()inference-chain/x/bls/types/message_submit_group_key_validation_signature.goinference-chain/x/bls/types/validate_basic_test.goValidateBasic()for threshold and verification submissionsinference-chain/x/bls/types/message_submit_partial_signature.goinference-chain/x/bls/types/message_submit_verification_vector.goinference-chain/x/bls/types/validate_basic_test.goSummary of Fixes
checkThresholdAndAggregate()no longer accepts duplicate slot indices in a single submission, preventing signers from tripping the threshold early.tSlotsDegree + 1instead of hardcodingtotalSlots/2 + 1.logging.Debug— Reconstructed secret key shares are no longer completely logged inlogging.Debug, preventing leakage of sensitive private key material.MsgRequestThresholdSignature.ValidateBasic()— Added validation to ensureChainIdandRequestIdare exactly 32 bytes and that data chunks follow the correct sizes, preventing EVM-incompatible payloads.MsgSubmitDealerPart.ValidateBasic()— Enforces strict size bounds for compressed G2 commitments and limits per-participant encrypted shares to prevent malformed or oversized payloads during DKG.MsgSubmitGroupKeyValidationSignature.ValidateBasic()— Added missing presence and length validations for signature fields and set boundary limits on theSlotIndicesarray.MsgSubmitPartialSignature.ValidateBasic()— Added validation on partial signature bytes and sets an upper bound on the list of slot indices to prevent state bloat and processing errors.MsgSubmitVerificationVector.ValidateBasic()— Properly bounds and limitsDealerValiditybitmaps from exceeding the maximum allowed limits to prevent memory and state inflation.