Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Valid

Unrestricted Access to RamNFT::mintRamNFT Allows Unauthorized NFT Minting

Summary

RamNFT::mintRamNFT is not protected, allowing any user to mint new NFTs without restriction.

Vulnerability Details

The RamNFT::mintRamNFT function is publicly accessible, allowing anyone to call it and mint new NFTs. This lack of access control means that a malicious user can exploit this vulnerability to mint a large number of NFTs. This can be particularly problematic in scenarios where the selection of the Ram is influenced by the number of NFTs held, as it allows the malicious user to disproportionately increase their chances of being selected as the Ram.

Impact

  • Manipulation of Selection Process: A malicious user can mint numerous NFTs to unfairly increase their chances of being selected as the Ram, thereby gaining an undue advantage in the selection process.

  • Resource Drain: Unrestricted minting can lead to resource exhaustion, as the contract may be overwhelmed with a large number of NFTs, potentially impacting its performance and increasing gas costs.

  • Economic Disruption: The value and integrity of the NFTs and the associated rewards can be undermined if users perceive the system as being manipulable or unfair.

Tools Used

Manual code review

Recommendations

Add onlyChoosingRamContract modifier

- function mintRamNFT(address to) public {
+ function mintRamNFT(address to) public onlyChoosingRamContract {
uint256 newTokenId = tokenCounter++;
_safeMint(to, newTokenId);
Characteristics[newTokenId] = CharacteristicsOfRam({
ram: to,
isJitaKrodhah: false,
isDhyutimaan: false,
isVidvaan: false,
isAatmavan: false,
isSatyavaakyah: false
});
}
Updates

Lead Judging Commences

bube Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

mintRamNFT is public

Support

FAQs

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