In BaseGauge.sol
, the contract only validates that it has enough tokens for the current reward rate period but fails to account for previously earned but unclaimed rewards. This could lead to a situation where the contract's total reward obligations exceed its token balance.
The issue exists in the notifyRewardAmount
function:
The vulnerability stems from three key factors:
The balance check only validates: rewardRate * getPeriodDuration() > balance
It doesn't account for already earned but unclaimed rewards stored in userStates[account].rewards
Rewards accumulate over time through getRewardPerToken()
and are stored in rewardPerTokenStored
Users' rewards are calculated in the earned
function:
Contract insolvency where total reward obligations exceed available tokens
Users being unable to claim their earned rewards
First-come-first-served situation for reward claims
Potential loss of user funds if they cannot claim their rightfully earned rewards
Attack Path:
Period 1: Contract receives 1000 tokens
Users earn but don't claim 800 tokens
Period 2: Contract receives another 1000 tokens
Balance check passes (1000 >= new_rate * duration)
Total obligations become 1800 tokens
This pattern can continue until obligations significantly exceed balance
Manual code review
Implement tracking of total unclaimed rewards:
Update unclaimed rewards tracking:
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.