The RAACNFT.sol contract does not enforce batch limits in the mint function, allowing users to mint NFTs beyond the intended batch size. This could lead to unauthorized minting, disrupting the protocol's intention of Allowing for batch minting of NFTs.
The root cause of this vulnerability lies in the absence of a check in the mint function to ensure that the _tokenId being minted falls within the currently allowed batch size. The contract defines currentBatchSize but does not use it to restrict minting.
The function addNewBatch increases currentBatchSize:
However, the mint function does not check whether _tokenId falls within currentBatchSize:
Since there is no condition like require(_tokenId < currentBatchSize, "Token ID exceeds current batch limit");, a user can mint tokens beyond the intended limit. This allows unauthorized minting and disrupts the expected NFT distribution.
Users can mint NFTs outside of the intended batch, leading to unintended token distribution.
The protocol's NFT release schedule can be manipulated, leading to loss of control over scarcity and demand.
Manual code review
To fix this issue, modify the mint function to include a validation check that ensures _tokenId does not exceed currentBatchSize. The fix could be implemented as follows:
This simple check ensures that minting is restricted to the allowed batch size, preventing unauthorized minting beyond intended releases.
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.