When updating tier configurations for a specific DAO, there is no validation on the minted
field of the TierConfig
struct, meaning that tier configurations can be updated with non-zero minted
values even when the supply for a given tier index is actually zero.
In MembershipFactory.sol
, the updateDAOMembership
function does not verify whether tierConfigs[i].minted
is zero when adding new tiers.
It only preserves the minted
values for existing tiers based on the current configuration length. This behavior means that any new tiers added during the update may have arbitrary non-zero minted values, as there is no validation to ensure they are initialized to zero.
Example scenario:
DAO A has the following tier configurations:
tier1.minted = 10
tier2.minted = 10
New tierConfigs
values are:
tier1.minted = 10
tier2.minted = 10
tier3.minted = 15
(incorrectly set)
The new tierConfigs.length
is 3, while the old dao.tiers.length
is 2.
As a result, tier1.minted
and tier2.minted
are preserved as 10, but tier3.minted
will be set to 15, as there is no validation to ensure that minted
is initialized to zero for new tiers.
Because the updateDAOMembership
function preserves the minted
values during each call, if the function is invoked again, the minted
values for existing tiers will continue to persist and cannot be fixed.
Each tier has a defined amount
, which represents the total number of members allowed in that tier. minted
is a counter that tracks the number of members who have joined that specific tier.
When someone attempts to join a DAO using the joinDAO
function, the following check ensures that there is room in the tier:
Example Scenario:
Suppose the amount
for tier 3 is set to 10, meaning it can accommodate up to 10 members. However, if the minted
value for tier 3 is set to 15, this check will evaluate as 10 > 15
, causing the function to revert with a "Tier full" error. As a result, no new members will be able to join tier 3, effectively locking it and preventing the DAO from onboarding new members in that tier.
Manual Review
Add a validation check for new tiers to ensure that any new tier configurations being added do not have a non-zero minted
value.
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.