TierConfig[].price is not compared among Tiers when MembershipFactory:createNewDAOMembership() and MembershipFactory:updateDAOMembership() is called thus making financial loss for DAO members and rendering the DAO broken.
MembershipFactory:createNewDAOMembership()L55-L63
MembershipFactory:updateDAOMembership()L100-L134
When a DAO is created or updated there is no validation check on TierConfig[].price. The price of lower indexed tier must be higher than higher indexed tier price which is not enforced in the code. And This lack of validation or misconfigured tiers can cause huge financial loss for a member in several ways.
1) Any member can buy lower indexed Tier membership token with less price and can get higher profit. Any member who tries to buy higher indexed Tier membership token will pay more and get less profit.
2) Any member who would try to upgrade their tier will burn two tokens which he bought with more price and get a token which is of less price. In this case profit share is not changed but the member would loss his fund.
Suppose A DAO creator creates a DAO with Tierconfig[0].price = 100 and Tierconfig[1].price = 200,which is not expected . it is possible to create the DAO, though this is very unlikely if we consider the DAO creator is sensible enough. But we can not rely on this assumption that a human won't make a mistake. And if this is validated Off-Chain in the backend, This still can happen if some one create a DAO directly on chain bypassing Off-Chain as On-chain is independent from Off-chain. While creating DAO this mistake can happen accidentally which will cause huge damage, actually would make the DAO broken. There's a off chain restriction on updateDAOMembership() function which is not the case for createNewDAOMembership() function
Make a .t.sol file in test folder and paste the code below then run command: forge test
Though Likelihood is low but the impact is critical causing financial loss for the members, breaking the invariant of the protocol which is allowing a DAO to be totally broken.
Manual review, foundry
While creating or updating DAO every consequent tier price must be checked and validated.
Add this code both in createNewDAOMembership() function and updateDAOMembership() function
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.