The way that rewards are distributed is the root cause of this issue
By taking a look at the StabilityPool::withdraw function, we see that first calculates the rewards and then transfers them:
This is good but the way that reward are calculated, allows a user to steal all of the RAACToken balance of the contract by doing the following attack:
Malicious user sees that the contract has a big RAACToken balance and deposits
Then immediately withdraws which will give him a big share of the rewards because of the following way rewards are calculated (They are strictly dependant on the user's balance, the total supply of deToken, the number of rewards and nothing more):
Then he can just repeat those actions until the contract is practically drained of RAACToken rewards
User can steal all of the RAACToken rewards from StabilityPool
Manual Review
Add some time based mechanism to the reward calculation so it is not profitable for the user to just deposit and withdraw right away.
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.