Basket.sol#handleFees()
could potentially cause disruption of minting and burning
#79
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Warden finding
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-09-defiProtocol/blob/main/contracts/contracts/Basket.sol#L110-L129
timeDiff * licenseFee
can be greater thanONE_YEAR
whentimeDiff
and/orlicenseFee
is large enough, which makesfeePct
to be greater thanBASE
so thatBASE - feePct
will revert on underflow.Impact
Minting and burning of the basket token are being disrupted until the publisher update the
licenseFee
.Proof of Concept
licenseFee
of1e19
or 1000% per year and mint 1 basket token;mint
andburn
reverts athandleFees()
.Recommended Mitigation Steps
Limit the max value of
feePct
.The text was updated successfully, but these errors were encountered: