Array size of pendingStakes
increases to huge value such that the traversal of it could cause the DOS issue.
Anyone can call the function increasePosition
to increase the TST and EURO. The amount of stake is added in an array.
https://github.com/Cyfrin/2023-12-the-standard/blob/91132936cb09ef9bf82f38ab1106346e2ad60f91/contracts/LiquidationPool.sol#L134-L142
Later this pendingStakes
would be used in the places as given in the impacted code link section. Lets see on of the place where the traversal of pendingStakes is done.
https://github.com/Cyfrin/2023-12-the-standard/blob/91132936cb09ef9bf82f38ab1106346e2ad60f91/contracts/LiquidationPool.sol#L181-L194
https://github.com/Cyfrin/2023-12-the-standard/blob/91132936cb09ef9bf82f38ab1106346e2ad60f91/contracts/LiquidationPool.sol#L73-L81
https://github.com/Cyfrin/2023-12-the-standard/blob/91132936cb09ef9bf82f38ab1106346e2ad60f91/contracts/LiquidationPool.sol#L55-L62
Increasing the array size indefinitely would lead to permanent DOS value.
This would impact the functioning of LiquidationPool contract.
Manual review.
We would suggest to add a cap on the number of pendingStakes for an user.
Once the cap is reached, user can wait till clearing of this array to add more in the pendingStake.
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.