There is a MembershipFactory.updateDAOMembership()
that is used to upgrade the DAO configurations. It can only be called by the `EXTERNAL_CALLER` role. It updates the tier configs, the maxmembers and no of tiers.
From the code we can see that the function knows that tierConfigs.length != dao.tiers.length
is possible and it is handling it.\
But the thing is that it is not handling the difference in length very well.
Lets take an example where the dao.tiers. length == 7
and tierConfigs.length == 6
The dao.noOfTiers
is updated to 6 from 7. It looks good at first but after the DAO update, if a user at tier 6 wants to upgrade to higher tier ,
It will fail at require(daos[daoMembershipAddress].noOfTiers >= fromTierIndex + 1
cos noOfTier = 6 < fromTierIndex = 6 +1 , which will fail the above check, making users unable to upgrade their tier.
Users will be unable to upgrade their lower tiers to higher ones and will miss out on rewards. And from the perspective of DAO the users are holding invalid tier of tokens even after the update with no way to upgrade their tier.
Keeping it medium impact since action is performed by trusted role while performing intended operation. And in the live walkthrough, the sponsor explicity stated that upgrading dao should not break any existing configurations.
Manual review
The fix for this is kinda tricky or rather ugly.
Dont update the noOfTiers in updateDAOMembership, it is used for validation only in joinDAO
and upgradeTier
but the sweet thing is that if user tiers to joinDao with a tier that is invalid now, it will fail the check at joinDAO
Since the amount field be 0 for invalid DAO. and it will work when user calls upgradeTier
.
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.