Submitted by catellatech, also found by Tripathi and nadin
https://github.com/GenerationSoftware/pt-v5-prize-pool/blob/4bc8a12b857856828c018510b5500d722b79ca3a/src/libraries/DrawAccumulatorLib.sol#L406-L407
https://github.com/GenerationSoftware/pt-v5-prize-pool/blob/4bc8a12b857856828c018510b5500d722b79ca3a/src/libraries/TierCalculationLib.sol#L26
The DrawAccumulatorLib.sol and TierCalculationLib.sol libraries inherit a version of PRBMath that contains a critical vulnerability in the pow() function, which can return inconsistent values. This vulnerability is of great importance to the PoolTogether protocol, as the pow() function is used in the computation of TierCalculationLib.getTierOdds and DrawAccumulatorLib.computeC.
Recently, another protocol has also experienced the same bug and the creators of the PRBMath have acknowledged this situation. Here is the corresponding request. Due to time constraints, we were unable to thoroughly address certain rounding errors with the mul and div functions of SD59x18. However, these errors have been corrected in PRBMath V4.
Proof of the bug acknowledgment by the creator of the PRBMath
This PR makes four significant changes:
To mitigate this issue, please update the contracts to 0.8.19 and upgrade the PRBMath to version V4.
Math
asselstine (PoolTogether) confirmed
Picodes (judge) decreased severity to Medium
PoolTogether mitigated:
Status: Mitigation confirmed. Full details in reports from 0xStalin, dirk_y and rvierdiiev.
