The updateStrategyRewards(uint256[] memory _strategyIdxs, bytes memory _data)
function can be used to update strategy rewards. However, if many strategies can be updated simultaneously, fee receivers could update them one by one to potentially steal users' rewards, resulting in fee receivers gaining more tokens and users receiving fewer tokens.
When updateStrategyRewards(uint256[] memory _strategyIdxs, bytes memory _data)
is called, the function invokes strategy.updateDeposits(_data)
for each strategy in _strategyIdxs
and subsequently updates the totalRewards
and totalStaked
variables. This process is instrumental in calculating the fees paid on the rewards. Notably, the fee distribution varies when updating all strategies simultaneously versus updating them one by one. Updating strategies individually allows fee receivers to potentially receive more rewards while users may receive fewer rewards in comparison.
Fee receivers can potentially receive more rewards than intended.
Users may receive fewer rewards than intended.
The rewards are different in the following PoC.
Manual code review
Consider updating all strategy rewards simultaneously to prevent discrepancies in calculations.
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.