The updateDAOMembership function in the DAO Membership Factory contract includes a flaw that allows the maxMembers limit to be adjusted without validation, leading to an unbounded increase in potential DAO members. This oversight can cause issues in membership management and potentially enable over-minting of memberships beyond the original intent.
In the updateDAOMembership function, the maxMembers limit, which restricts the total number of members a DAO can have, is recalculated based on new tierConfigs input. However, the code does not validate whether the calculated maxMembers aligns with the DAO’s intended capacity or membership limits. This absence of verification can result in an unintended increase in the maxMembers value, allowing additional members beyond the previously set cap.
The following code from updateDAOMembership demonstrates the unchecked adjustment of maxMembers:
maxMembers is recalculated by summing up the amount fields of each tier in tierConfigs.
If this new sum exceeds the original dao.maxMembers, the function updates dao.maxMembers to this new value without any validation.
This allows for unchecked increases in maxMembers, leading to an expanded membership cap that was not originally intended or authorized.
Let's create a test by updating the tierConfigs with an inflated amount for each tier, thereby bypassing any original membership limits.
Test show that maxMembers was updated from 30 to 100 due to the increased amount values in the new tierConfigs, confirming that the maxMembers limit was overwritten without checks.
This vulnerability allows administrators or external callers with EXTERNAL_CALLER privileges to increase maxMembers arbitrarily, potentially allowing far more members than the DAO was originally intended to manage.
Expanding the membership cap can place a strain on DAO resources, and the unchecked increase could expose the DAO to unforeseen risks, including dilution of membership value and decision-making integrity.
-
To prevent unauthorized increases in maxMembers, add a validation check to ensure that maxMembers cannot exceed a predefined, immutable limit set during DAO creation. Additionally, explicitly check that maxMembers aligns with any intended or strategic limitations before allowing an increase.
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.