NFT can be minted for free after sale ended
After the sale ended, the price function returned zero, allowing anyone to mint the remaining NFTs for free. An attacker could deploy a contract to claim all remaining NFTs ahead of regular users.
Larva Labs Meebits
Originally disclosed on Code4rena
The getPrice() function returned 0 after the sale ended and (SALE_LIMIT - numSales) NFT can be minted for free.
Without documentation, it’s not clear if this is the expected behavior or not. If it’s unexpected, it is recommended to revert instead of returning 0. If it’s expected behavior, it’s possible to create a smart contract and claim all the remaining NFT front-running the regular users.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the price calculation returns zero once the sale has ended instead of blocking further minting.
Impact
The remaining NFTs could be minted for free, and a contract could front-run regular users to take them all.
What the attacker needed
Sale has ended; no payment required
The fix
The contract should revert once the sale has ended rather than returning a zero price.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract is a program on a blockchain that runs automatically. This one had a function that calculates the price of an NFT, and after the sale period it returned zero instead of stopping sales. That meant anyone could keep minting NFTs without paying anything.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.