There are no safeguards to prevent a whale depositor to sandwich rewards and claim a share of unclaimed rewards.
The current implementation of calculateRaacRewards is prone to sandwiches and theft of unclaimed yield as it calculates totalRewards using the live balance of the stability pool multiplied by the % of user's shares against all shares.
Whenever a large amount of rewards is expected to be added or there are unclaimed rewards attackers can do the following:
Deposit a large amount of tokens
New rewards are minted and added to the contract alongside the already existing balance
Withdraw entire balance
This way the reward calculation involves the entire balanceOf which is a mix of unclaimed yield and newly added one. User will claim a share of the contract's balance which does not belong to him.
Theft of yield
Do not use live balanceOf to determine reward amounts.
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.