The StabilityPool lacks a time tracking mechanism for deposits and withdrawals, allowing a malicious user to exploit this by executing a flash loan attack. This vulnerability enables the attacker to drain the full RAAC rewards from the pool without holding any long-term deposits.
In the current implementation of the StabilityPool, both the deposit() and withdraw() functions do not track the time associated with user deposits or withdrawals. This oversight allows an attacker to manipulate the reward distribution as follows:
The withdraw() function does not incorporate any time-based checks:
Attack Path
The attacker takes out a flash loan to acquire rToken from the LendingPool.
They deposit the rToken into the StabilityPool.
Immediately after depositing, the attacker calls withdraw(), receiving the full RAAC rewards calculated based on the total deposits, without any time-based restrictions.
The attacker repays the flash loan, all within a single transaction.
The reward calculation in calculateRaacRewards() is based on the total deposits without considering the duration of the deposit:
This vulnerability allows an attacker to drain the RAAC rewards from the stability pool through a flash loan attack, potentially leading to significant financial losses for the protocol and its users. The lack of a time-based mechanism undermines the integrity of the reward distribution model.
Manual Review
To mitigate this vulnerability, it is essential to implement a time tracking mechanism for deposits and withdrawals in the StabilityPool. This mechanism should ensure that rewards are calculated based on the duration for which the funds are held in the pool.
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.