No max for defaultIncentive #189
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate
This issue or pull request already exists
invalid
This doesn't seem right
Handle
gpersoon
Vulnerability details
Impact
The function setDefaultIncentive of StabilizerNode.sol doesn't check for a maximum value of _incentive.
If _incentive would be very large, then defaultIncentive would be very large and the function _replenishLiquidityExtension() would mint a large amount of malt.
The function setDefaultIncentive() can only be called by an admin, but a mistake could be made.
Also if an admin would want to do a rugpull, this would be an ideal place to do it.
Proof of Concept
https://github.com/code-423n4/2021-11-malt/blob/d3f6a57ba6694b47389b16d9d0a36a956c5e6a94/src/contracts/StabilizerNode.sol#L402-L411
https://github.com/code-423n4/2021-11-malt/blob/d3f6a57ba6694b47389b16d9d0a36a956c5e6a94/src/contracts/StabilizerNode.sol#L344
Tools Used
Recommended Mitigation Steps
Check for a reasonable maximum value in setDefaultIncentive()
The text was updated successfully, but these errors were encountered: