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

No acess control on the `RamNFT::mintRamNFT` function.

Summary

No acess control on the RamNFT::mintRamNFT function.

Vulnerability Details

For a user to get the RamNFT they need to call the Dussehra::enterPeopleWhoLikeRam function, pay the entrance fee and then mint the RamNFT and it can only be done once. But a user can bypass this by calling the RamNFT::mintRamNFT function directly.

Code
function test_CanMintNftWithoutPaying() public {
vm.startPrank(player1);
ramNFT.mintRamNFT(player1);
vm.stopPrank();
assertEq(ramNFT.ownerOf(0), player1);
}

Impact

The user can mint the RamNft without paying the entrance fee, they can mint as much RamNFT as they want, get their RamNFT to be selected as ram and collect the rewards.

Tools Used

Manual analysis

Recommendations

Add acess control to the RamNFT::mintRamNFT function so it can only be called by the Dussehra contract.

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.