Link to Affected Code:\
https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/pools/StabilityPool/StabilityPool.sol#L251-L259
https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/pools/StabilityPool/StabilityPool.sol#L326-L337
Description:
The StabilityPool's reward distribution mechanism is vulnerable to sandwich attacks around depositRAACFromPool transactions. The vulnerability exists because calculateRaacRewards() calculates rewards based on the current RAAC balance in the pool and the user's current deposit ratio, without considering deposit duration.
When RAAC rewards are being deposited to the pool via depositRAACFromPool, an attacker can front-run this transaction with a large deposit, capture a portion of the rewards, and immediately withdraw - all without maintaining any meaningful stake in the protocol.
Impact:
Attackers can extract RAAC rewards without meaningful protocol participation
Legitimate long-term stakers receive reduced rewards
Undermines the protocol's reward incentive mechanism
Economic value extraction through MEV
Proof of Concept:
Initial State:
StabilityPool has 10M rToken in deposits
1000 RAAC rewards pending to be deposited via depositRAACFromPool
Attack Sequence:
Attacker monitors mempool and sees pending depositRAACFromPool transaction
Attacker front-runs with:
Now owns ~9.09% of pool (1M/11M total deposits)
depositRAACFromPool executes:
1000 RAAC gets deposited to StabilityPool
Attacker immediately back-runs with:
Result:
Attacker receives:
1M rToken back (original deposit)
~90.9 RAAC (9.09% of 1000 RAAC rewards)
Attack took 2-3 blocks
No long-term stake required
Can be repeated for every reward deposit
Recommended Mitigation:
Implement reward vesting with minimum lock periods:
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.