Submitted by Udsen, also found by catellatech, Inspecktor, squeaky_cactus, 0xPsuedoPandit, 0x11singh99, Tripathi, Nyx, Daniel526 (1, 2), namx05, Jorgect, Praise (1, 2), xuwinnie, YY, and Darwin
In the PrizePool.constructor the drawManager state variable is set as follows:
But it accepts, even if the params.drawManager == address(0). There is no input validation for the address(0) as well.
The PrizePool.setDrawManager function is used to set the drawManager if not already set. But the problem here, is that there is no access control for this function and anyone can call this. A malicious user can front-run the valid drawManager assignment transaction and set a malicious address as the drawManager. The other issue, is once the drawManager is set, it can not be updated due to the following conditional check. Hence, the contract will have to redeployed.
The following two functions controlled by the onlyDrawManager modifier will be vulnerable to attacks, since the drawManager is a malicious address now.
https://github.com/GenerationSoftware/pt-v5-prize-pool/blob/4bc8a12b857856828c018510b5500d722b79ca3a/src/PrizePool.sol#L278-L281
https://github.com/GenerationSoftware/pt-v5-prize-pool/blob/4bc8a12b857856828c018510b5500d722b79ca3a/src/PrizePool.sol#L299-L306
https://github.com/GenerationSoftware/pt-v5-prize-pool/blob/4bc8a12b857856828c018510b5500d722b79ca3a/src/PrizePool.sol#L348
https://github.com/GenerationSoftware/pt-v5-prize-pool/blob/4bc8a12b857856828c018510b5500d722b79ca3a/src/PrizePool.sol#L335-L342
VSCode
It is recommended to check for address(0) in the constructor when drawManager is set; or to implement access control in the PrizePool.setDrawManager function, so that only the admin of the contract can call this function to set the drawManager, if it is not set already.
Invalid Validation
PoolTogether confirmed via discord communication
PoolTogether mitigated:
Status: Mitigation confirmed. Full details in reports from rvierdiiev, dirk_y and 0xStalin.
