The function getRewardPerToken() calculates the reward per staked token using the formula:
This implementation does not account for extremely low liquidity scenarios, where totalSupply() is very small or temporarily zero. If totalSupply() is close to zero, the division
can lead to massively inflated reward calculations, causing disproportionate rewards for the next staker who joins after a period of low liquidity.
Example exploit scenario:
Assume totalSupply() = 1 wei and rewardRate is high.
The calculation (rewardRate * timeElapsed * 1e18) / totalSupply() results in an excessively large rewardPerToken value.
A new user stakes tokens after this calculation and receives inflated rewards far beyond what is expected.
This results in unfair rewards distribution, where opportunistic users can wait for a period of low liquidity, stake immediately after, and drain excessive rewards.
Massively inflated rewards allow a single user to drain a disproportionate share of rewards during low liquidity periods.
Introduce an upper bound on rewardPerToken() increases by capping the maximum possible rewardPerTokenStored update per period.
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.