The StabilityPool contract contains a critical flaw in its reward distribution mechanism that allows anyone to drain a all the rewards amount of RAAC . The issue stems from calculating and distributing rewards on each withdrawal without proper accumulation tracking, enabling attackers to repeatedly withdraw small amounts to claim an unfair share of the total rewards.
The vulnerability exists in how rewards are calculated and distributed during withdrawals in the StabilityPool contract :
The key issues that make this exploitable:
Rewards are calculated and distributed on EACH withdrawal using the formula:
there is no tracking of already claimed rewards or reward rate over time
Each withdrawal recalculates rewards based on current total rewards and user deposit
Previous withdrawals don't reduce the user's claimable share
The reward amount is proportional to the user's deposit but independent of the withdrawal amount
Even a 1 wei withdrawal triggers a full reward calculation
The user can withdraw minimal amounts repeatedly to claim rewards multiple times or repeatedly deposit and withdraw until they completely drain the pool from all the rewards
Attacker can drain all the rewards from the stability pool
Implement a reward accumulator pattern similar to MasterChef
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.