In LiquidationPool.sol
we have the following function which allows users to first create a pending stake and later on that pending stake is transformed into a position
The EURO
token has 18 decimals, and the increasePostion()
function allows us to deposit 1 WEI
. A malicious user can create hundreds of thousands of pending stake positions, for les than 1 EURO
and gas costs. And when in turn
is called in order to transform the pending stakes into positions, this function ends up running a for loop over an unbounded array. This array can be made to be sufficiently large to exceed the block gas limit and cause out-of-gas errors and stop the processing of any rewards and assets to the non malicious stakers in the contract.
This in turns makes the whole contract obsolete as the only function that could be called would be the claimRewards()
, but it could only withdraw rewards that were accrued prior to the malicious user stuffing the pendingStakes array with very small positions.
Manual review
Consider setting a minimum value that user needs to deposit in order to call increasePosition()
something of the sort of 100e18
.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.