Submitted by Infect3d, also found by Aymen0909
Heres the documentation of the TwabLib::getTwabBetween function:
TwabLib::getTwabBetween -function gets called in. Then, PrizePool::_getVaultUserBalanceAndTotalSupplyTwab gets called by PrizePool::claimPrize, returning twab for a specified time range, which finally is called by PrizePool::isWinner in PrizePool::claimPrize.
The thing is, as explained by the documentation, values from balance history arent guaranteed to be accurate if the timestamp at which time it is queried do not fall between:
That is because until a period has ended, we cannot be sure the value we are querying hasnt changed in the future (from pov of the timestamp).
This means, that if a prize is claimed, but timestamps at which the twab is getting requested do not follow these rules, the Prize Pool contract might distribute prizes based on inaccurate data. This could lead to the prizes being distributed to users who should not have won, or not being distributed to users who should have won.
Add a isTimeRangeSafe check (will depend on how devs want to handle it, either a revert or another error management solution) before getTwabBetween to ensure queried balances are accurate; otherwise, prize distribution could be unfair.
Invalid Validation
asselstine (PoolTogether) confirmed
PoolTogether mitigated:
Status: Mitigation confirmed. Full details in reports from dirk_y and rvierdiiev.
