In the upgradeTier function of MembershipFactory.sol, there is an arithmetic underflow vulnerability when fromTierIndex is 0, as the function attempts to mint a token for fromTierIndex - 1.
The vulnerability exists in the following code section:
The issue arises when:
A user calls upgradeTier with fromTierIndex = 0
The function passes the initial checks
When executing fromTierIndex - 1, it will underflow since 0 - 1
Lead to Arithmetic Underflow
Manual code review
Add a check to prevent tier 0 from attempting to upgrade:
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.