fjordStaking::unstakeAll vulnerable to DoS due to Out of Gas Errors because of unbouded array loop
The vulnerability is present in fjordStaking's unstakeAll method because it has an unbounded loop:
All attempts to unstakeAll will fail for a user who has a lot of activeDeposits (more than 6454) because of gas exhaustion
The following proof of concept shows that all attempts to unstakeAll will fail for a user with a lot of deposits
Add this test case in test/integration/AAAstakeUnstake.t.sol
Execute test file with
Observe tx will fail and user is unable to unstakeAll his deposits
Unability to withdraw all staked positions in some scenarios
Manual Review
Implement a new method in fjordStaking that receives a uint parameter that specifies how many deposits to unstake.
This will allow users to unstake and arbitrary amounts of deposits and gas saving instead of unstake positions one by one using unstake method
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.