Closed code423n4 closed 1 year ago
0xean changed the severity to QA (Quality Assurance)
This previously downgraded issue has been upgraded by 0xean
This previously downgraded issue has been upgraded by 0xean
0xean marked the issue as duplicate of #386
0xean changed the severity to QA (Quality Assurance)
0xean marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2023-05-venus/blob/8be784ed9752b80e6f1b8b781e2e6251748d0d7e/contracts/MaxLoopsLimitHelper.sol#L26
Vulnerability details
Impact
If the owner set maxLoopLimit too high then you need to upgrade the contract and your code to avoid possible DOS.
Proof of Concept
The variable
maxLoopLimit
is touched by admins of contracts that inherits them.I have noticed that in your design you do not allow to decrease that variable
To me this is an error because generally when you set a max variable you compare with your previous version.
However, in this case is not recommended.
Sample Poc
The owner increase a little bit maxLoops.
Then she noticed that the value is too high because it certainly causes DOS .
You will need to upgrade your contract, even you need to upgrade you code as well. The reason is that
initialize()
will fail in the new upgraded contract.Recommended
I suggest you that
MaxLoopLimitHelper
can be set between a range of reasonable parameters by the owner like MINMAXLOOPS and MAXMAXLOOPS and avoid zero of course.Assessed type
Other