sherlock-audit / 2023-02-hats-judging

2 stars 0 forks source link

duc - Signatures can duplicate in function `countValidSignatures` #98

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

duc

medium

Signatures can duplicate in function countValidSignatures

Summary

Signatures can duplicate in function countValidSignatures

Vulnerability Detail

In contract HatsSignerGateBase.sol, function countValidSignatures is a public function which used to count number of valid signers from the signatures. But there is not the check to prevent duplicated owners from the signatures.

Impact

Because countValidSignatures is a public function, any user/protocol can use it to check their signatures. And the wrong results lead to misunderstandings for them.

Code Snippet

https://github.com/Hats-Protocol/hats-zodiac/blob/9455cc0957762f5dbbd8e62063d970199109b977/src/HatsSignerGateBase.sol#L547-L591

Tool used

Manual review

Recommendation

Should add the check to prevent duplicated owners from signatures (follow contract GnosisSafe)