MinterContract::lastMintDate Manipulation for Sales Option 3 in MinterContract::mint() #1573
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-688
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/MinterContract.sol#L240-L253
Vulnerability details
Impact
The mint() function uses lastMintDate to limit mints to 1 per timePeriod for salesOption 3.
The logic controlling mint frequency for salesOption 3 relies solely on comparing the current timestamp to lastMintDate. This allows the rate limit to be bypassed by waiting longer than the timePeriod between mints.
By deliberately waiting longer than the timePeriod, an attacker can arbitrarily mint multiple NFTs without limit.
Proof of Concept
Tools Used
Manual Review
Recommended Mitigation Steps
Add validation that time since last mint is less than timePeriod:
Assessed type
Timing
The text was updated successfully, but these errors were encountered: