The StabilityPool.withdraw()
function allows users to withdraw rToken
and receive RAAC rewards based on their total deposits, rather than the amount they are withdrawing. This creates a vulnerability where a malicious user can exploit this behavior to drain RAAC rewards from the pool by repeatedly invoking the withdraw()
function with minimal withdrawal amounts.
In the StabilityPool.withdraw()
function, the calculation of RAAC rewards is performed using the calculateRaacRewards(msg.sender)
function:
The calculateRaacRewards()
function calculates the user's rewards based on their total deposits, not the amount being withdrawn:
An attacker can exploit this by repeatedly calling the withdraw()
function with a very small deCRVUSDAmount
. Since the rewards are calculated based on the user's total deposits, the attacker can drain the RAAC rewards from the stability pool without proportionate withdrawals.
For example:
The attacker deposits a certain amount of rToken to the stability pool.
They then call withdraw()
with a minimal amount multiple times.
Each time, they receive rewards calculated on their total deposit, leading to excessive draining of RAAC tokens.
This vulnerability allows malicious users to drain RAAC rewards from the stability pool, which can significantly impact the reward distribution and integrity of the system. It undermines the intended reward mechanism, leading to potential financial loss for the protocol and its users.
Manual Review
To mitigate this vulnerability, it is recommended to modify the calculateRaacRewards()
function to include the withdrawal amount in its calculations. This change will ensure that rewards are only distributed based on the amount being withdrawn, rather than the user's total 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.