In updateDAOMembership, if the new tierConfigs is smaller than the current noOfTiers, data from higher-index tiers is deleted, causing irreversible data loss and inconsistency.
In the updateDAOMembership function, the array tierConfigs is directly assigned to replace the current dao.tiers data without considering noOfTiers:
If the new tierConfigs.length is smaller than the previous noOfTiers, data from the original tiers with indices exceeding tierConfigs.length - 1 will be permanently lost.
Example Scenario:
noOfTiers was previously set to 7, so tiers 0 through 6 exist.
The updateDAOMembership function is called with a tierConfigs array of length 5.
This update will remove all data from tiers 5 and 6, causing data loss and inconsistency.
This issue leads to irreversible loss of tier data whenever tierConfigs has fewer entries than the current noOfTiers, resulting in potential discrepancies in DAO membership management.
Manual
Redesign the function to validate tierConfigs.length against the current noOfTiers and preserve or handle higher-index tier data as necessary.
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.