Closed sherlock-admin2 closed 9 months ago
1 comment(s) were left on this issue during the judging contest.
takarez commented:
invalid: The lenght of the validatorIDs is controlled by a governance which is considered trusted according to sherlock rules VIII number 4 under "exceptions"
cawfree
high
Panic: Validators with IDs over
255
will prevent quorum blocks from finalizing.Summary
When finalizing a block specimen proof that has reached quorum, a
participant
with avalidatorID
greater than255
will cause finalization to revert with underflow.Vulnerability Detail
Once a block specimen hash has met quorum, the internal function
_finalizeWithParticipants(BlockSpecimenSession,uint64,uint64,bytes32,bytes32)
is called to export the finalized results of the quorum.When computing the
validatorBitMap
, avalidatorID
is used to determine the bit offset corresponding to the validator:However,
validatorID
s are notuint8
s, they areuint128
s (without restriction), meaning that for any identifier for a validator over255
participating in majority-consensus validation will lead to numeric underflow during block finalization.Impact
I consider this issue to be high severity as it prevents the proof chain from progressing specifically for the scenario where sufficient quorum has been met, preventing majority consensus votes from being finalized.
Further, as there is no significant economic constraint against programmatically generating multiple
Validator
instances, therefore it would be possible to quickly reach the aforementioned threshold value if the intention were to explicitly grief the protocol - even unrelated newValidator
s that enter the protocol will be unintentionally complicit to this attack.Code Snippet
Tool used
Foundry
Recommendation
Consider constructing the bitmap using the offset of participants in the order they engaged within consensus for the block being finalized, opposed to their global identifier.
Duplicate of #81