In FjordStaking.sol
The mapping _activeDeposits
is used for accounting in which epoch user have staked tokens. It is unbounded array that holds every epoch that user have staked tokens.
When unstakeAll() functions is called it iterates through all eras in which the user has a stake and calculate staked tokens for every epoch.
Attacker can call stake() with small amount in every epoch, until the count of epoch in _activeDeposits
is too large. By generating a large number of epoch the attacker causes the array returned by _activeDeposits
to become excessively large. This leads to high gas consumption and potential transaction failure due to insufficient gas.
Mallicious user can call FjordStaking.sol::unstakeAll()
with a large number of epochs and may interfere with other transactions in any block in which it is included. This will prevent the normal functioning of the protocol.
Manual review
There are 2 ways:
Limit the number of iterations in the unstakeAll() function.
Set a maximum limit on active deposits.
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.