The `updateDAOMembership` function in the MembershipFactory contract is responsible for updating the tier configurations of a specific DAO.
here this function correctly check all the parameters correctly However, the function lacks a critical check to ensure that the length of the new TierConfig[] array matches the length of the existing tiers i.e dao.noOfTiers
. This oversight can lead to unintended data loss or misalignment of tier data.
i.e here
The function does not verify that tierConfigs.length matches dao.tiers.length or dao.noOfTiers before updating the tiers.
The existing dao.tiers array is deleted without ensuring that the new configuration aligns with the previous one, leading to potential data loss.
let's understand this with short example,
Existing DAO: A DAO has 3 tiers with specific configurations.
Update Attempt: update the DAO with a tierConfigs array of 2 tiers.
The function deletes the existing 3 tiers and replaces them with the new 2 tiers, resulting in the loss of data for the third tier.
data of the tier will be completely lost like no of mints and amount which leads to new users cannot join the dao
manual review
Before deleting dao.tiers, add a check to ensure that tierConfigs.length matches dao.tiers.length or dao.noOfTiers.
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.