This repository has been archived by the owner on Jun 11, 2023. It is now read-only.
obront - targetThreshold can be set below minThreshold, violating important invariant #36
Labels
Fix Approved
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
HSG
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
obront
medium
targetThreshold can be set below minThreshold, violating important invariant
Summary
There are protections in place to ensure that
minThreshold
is not set abovetargetThreshold
, because the result is that the max threshold on the safe would be less than the minimum required. However, this check is not performed whentargetThreshold
is set, which results in the same situation.Vulnerability Detail
When the
minThreshold
is set onHatsSignerGateBase.sol
, it performs an important check thatminThreshold <= targetThreshold
:However, when
targetThreshold
is set, there is no equivalent check that it remains aboveminThreshold
:This is a major problem, because if it is set lower than
minThreshold
,reconcileSignerCount()
will set the safe's threshold to be this value, which is lower than the minimum, and will cause all tranasctions to fail.Impact
Settings that are intended to be guarded are not, which can lead to parameters being set in such a way that all transactions fail.
Code Snippet
https://github.com/Hats-Protocol/hats-zodiac/blob/9455cc0957762f5dbbd8e62063d970199109b977/src/HatsSignerGateBase.sol#L95-L114
Tool used
Manual Review
Recommendation
Perform a check in
_setTargetThreshold()
that it is greater than or equal tominThreshold
:The text was updated successfully, but these errors were encountered: