Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: medium
Invalid

Missing Token ID Validation in NFT Mint Function

Summary

The mint function in RAACNFT contract lacks validation for token ID existence and range, potentially allowing minting of duplicate NFTs or NFTs with IDs outside the allowed range.

Vulnerability Details

function mint(uint256 _tokenId, uint256 _amount) public override {
uint256 price = raac_hp.tokenToHousePrice(_tokenId);
if(price == 0) { revert RAACNFT__HousePrice(); }
if(price > _amount) { revert RAACNFT__InsufficientFundsMint(); }
// No check if tokenId > currentBatchSize
// No check if tokenId already exists
token.safeTransferFrom(msg.sender, address(this), _amount);
_safeMint(msg.sender, _tokenId);
...
}

The function fails to validate:

  1. If the tokenId is within the current batch range (currentBatchSize)

  2. If an NFT with this tokenId already exists

  3. If the tokenId is valid (e.g., non-zero)

Impact

Potential minting of duplicate tokens.

Tools Used

Manual review

Recommendations

Add proper validation checks.

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.