Submitted by WatchPug
Every time the BkdLocker#depositFees() gets called, there will be a surge of rewards per locked token for the existing stakeholders.
This enables a well-known attack vector, in which the attacker will take a large portion of the shares before the surge, then claim the rewards and exit immediately.
While the _WITHDRAW_DELAY can be set longer to mitigate this issue in the current implementation, it is possible for the admin to configure it to a very short period of time or even 0.
In which case, the attack will be very practical and effectively steal the major part of the newly added rewards.
https://github.com/code-423n4/2022-05-backd/blob/2a5664d35cde5b036074edef3c1369b984d10010/protocol/contracts/BkdLocker.sol#L90-L100
Given:
As a result, the attacker has stolen half of the pending fees which belong to the old users.
Consider switching the reward to a rewardRate-based gradual release model, such as Synthetixs StakingRewards contract.
See: https://github.com/Synthetixio/synthetix/blob/develop/contracts/StakingRewards.sol#L113-L132
chase-manning (Backd) disputed and commented:
Alex the Entreprenerd (judge) decreased severity to Medium and commented:
