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

12 stars 7 forks source link

Vault's Owners can deploy fake PrizePools & TwabControllers contracts that can contain logic to cheat on users and alter the balances to get away with all the Prizes & potentially steal all the users underlying assets #239

Closed code423n4 closed 1 year ago

code423n4 commented 1 year ago

Lines of code

https://github.com/GenerationSoftware/pt-v5-vault/blob/b1deb5d494c25f885c34c83f014c8a855c5e2749/src/VaultFactory.sol#L55-L86 https://github.com/GenerationSoftware/pt-v5-vault/blob/b1deb5d494c25f885c34c83f014c8a855c5e2749/src/Vault.sol#L258-L260

Vulnerability details

Impact

Proof of Concept

Tools Used

Manual Audit

Recommended Mitigation Steps

}



- It is up to the protocol's decision whether they'd like to implement some functions to allow them to update the addresses of the TwapController and PrizePools in case those contracts are redeployed, and updated, but this means that the `VaultFactory` will need to introduce an owner.
  - This should be discussed by the protocol if this is something they'd like to do.

- If the protocol decides not to implement functions to update the TwapController and PrizePools addresses, then those variables could be set as `immutable`.

- Despite the final decision the protocol takes about implementing functions to update the TwapController and PrizePools contracts, the main suggested change needs to be implemented. Allowing vault's creators to set arbitrary addresses for core contracts can lead to undesired outcomes where users can even lose all their deposits

## Assessed type

Other
c4-judge commented 1 year ago

Picodes marked the issue as duplicate of #324

c4-judge commented 1 year ago

Picodes changed the severity to 2 (Med Risk)

c4-judge commented 1 year ago

Picodes marked the issue as satisfactory