mintNFT() is vulnerable to reentrancy via onERC721Received(), allowing a single user to mint multiple NFTs in a single transaction and bypass fair distribution.
Normally, mintNFT() allows users to mint NFTs while respecting whitelist, reveal state, and supply limits, ensuring fair distribution among all participants.
The function calls _safeMint without reentrancy protection. When the receiver is a contract implementing onERC721Received(), it can reenter mintNFT() multiple times before the transaction completes, allowing one user to mint a large number of NFTs at once.
Likelihood: Medium
Any user deploying a contract with onERC721Received() can trigger multiple reentries during a single mint transaction.
Impact: Low
One user can mint a disproportionate amount or even all available NFTs in a single transaction.
Other users are disadvantaged or completely blocked from minting, violating fair distribution rules.
Add a reentrancy protection using OpenZeppelin’s ReentrancyGuard:
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.
The contest is complete and the rewards are being distributed.