It needs to check if normalizedTargetUnit is zero in the _isQuoteAssetExcessOrAtTarget function
Summary
If the normalizedTargetUnit is zero, it will raise the overflow error in the approximatelyEquals function.
This means all the associated functions could not be callable including bid, unlock.
blackhole
high
It needs to check if normalizedTargetUnit is zero in the
_isQuoteAssetExcessOrAtTarget
functionSummary
If the normalizedTargetUnit is zero, it will raise the overflow error in the
approximatelyEquals
function. This means all the associated functions could not be callable includingbid
,unlock
.Vulnerability Detail
https://github.com/sherlock-audit/2023-06-Index/blob/main/index-protocol/contracts/protocol/modules/v1/AuctionRebalanceModuleV1.sol#L1210-L1215
Impact
As a result, the associated functions including the
bid
,unlock
,raiseAssetTargets
, are prevented from functioning properly.Code Snippet
https://github.com/sherlock-audit/2023-06-Index/blob/main/index-protocol/contracts/protocol/modules/v1/AuctionRebalanceModuleV1.sol#L1210-L1215 https://github.com/sherlock-audit/2023-06-Index/blob/main/index-protocol/contracts/lib/PreciseUnitMath.sol#L218
Tool used
Manual Review
Recommendation
Recommend adding the validation to check if the normalizedTargetUnit is zero