code-423n4 / 2023-07-pooltogether-findings

12 stars 7 forks source link

Incorrect distribution of shares and liquidity as a result of total number of shares not equaling 100 #377

Closed code423n4 closed 1 year ago

code423n4 commented 1 year ago

Lines of code

https://github.com/GenerationSoftware/pt-v5-prize-pool/blob/4bc8a12b857856828c018510b5500d722b79ca3a/src/abstract/TieredLiquidityDistributor.sol#L235

Vulnerability details

Impact

If the shares are not properly validated and do not add up to 100, there will be an imbalance in the distribution of funds resulting in loss of funds or locked funds that cannot be accessed or distributed correctly.

Proof of Concept

The constructor of the TieredLiquidityDistributor contract sets the values of _tierShares, _canaryShares, and _reserveShares based on the arguments passed to it. However, it does not include any validation to ensure that the sum of these values equals 100, which is a common requirement for distributing shares.

Tools Used

Manual

Recommended Mitigation Steps

Modify the constructor to ensure that _tierShares + _canaryShares + _reserveShares == 100. This check will ensure the correct distribution of shares and liquidity among tiers and prevent any unintended consequences due to incorrect share allocations.

Assessed type

Invalid Validation

c4-judge commented 1 year ago

Picodes marked the issue as unsatisfactory: Invalid