The unstakeAll() function in the FjordStaking contract contains a loop that iterates over all active deposits of a user. If a user has a large number of active deposits, this loop could exceed the block gas limit, causing the transaction to fail. This situation could be exploited by malicious users to create a denial-of-service (DOS) scenario, preventing other users from being able to successfully unstake their tokens.
In this function, the contract loops through all active deposit epochs of a user to unstake them. If a user has a very high number of active deposits, this loop could consume more gas than is allowed per block. As a result, the transaction would fail, leading to a situation where it is impossible to unstake tokens.
The main impact of this vulnerability is the potential for denial-of-service (DOS) attacks:
User Lockout: A user with many active deposits might be unable to unstake their tokens, effectively locking their funds.
Systemic Risk: An attacker could exploit this by generating many small deposits, creating a large number of active deposits. This would make the unstakeAll() function fail due to gas limits, thus preventing other users from using the function successfully.
This issue not only affects individual users but could also degrade the overall usability and reliability of the staking contract, leading to a loss of confidence in the system.
Allow Partial Unstaking: Implement a function that allows users to unstake a specific subset of their deposits, rather than all at once. This would give users the flexibility to manage their gas usage and prevent complete lockout scenarios.
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.