Missing minted value check in updateDAOMembership() may cause amount < minted inequality
updateDAOMembership()function is used for updating the tier configurations of the DAO. It considers the current minted amounts while updating the DAO.
Our new tier config is updated with current dao's tier's minted values. Later, we're removing the all the items from old dao tiers and we're pushing our updated tier config
In here, we're using the new tier config amounts for update and it will overwrite the old amounts. The vulnerability arise here because if our new amount value is lower than the previous amount value, we should also check the already minted value is lower than the new amount value. The amountvalue represents the maximum mintable NFT amount of that tier and the following inequality should be always true:
External caller is trusted in here and we expect he will never pass an incorrect amount value here but we still need that check because in chain re-org or front-running the transaction attack vectors, we can't guarantee that situation won't happen.
In tier index 0, the amountvalue is 11 and the minted value is 10. There is 1 available slot for tier index 0.
External caller wants to update the amountto 10.
Attacker sees the external caller's transaction and he called joinDAOwith tier index 0. ( With frontrun )
Now the protocol will mint 1 NFT to attacker and it will update the minted value to 11.
Then, external caller's transaction is executed and amount is 10 right now.
The inequality will be false.
Following test should be failed normally but it doesn't fail.
Medium - It will break the core system functionality and it will cause minted > amount. Additionally, it will bypass the max member limit because max member always holds the summation of all the tier amounts.
Manual Review
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.