According to the documentation only the Dussehra
contract is supposed to mint RamNFTs
and only after payment of the entrance fee. However, this logic is not implemented in the contract and everyone can mint RamNFT
without payment. Furthermore, they can use this minted NFT into challenges and become the Ram.
RamNFTs
are minted by the RamNFT::mintRamNFT
function. This function takes the adress to which the NFT is minted. It does not check whether it is executed from the deployed Dussehra
contract or not. This breaks the described logic. Furthermore, due to another vulnerability the users can challenge the same or different minted to them NFTs and be sure to become the Ram no matter the implemented random logic.
The following test demonstrates that everyone can mint RamNFT
without payment of the entrance fee.
The next code demonstrates how the users can even mint multiple NFTs which can further be used so that the user became Ram.
The missing check for who can execute RamNFT::mintRamNFT
breaks the logic of the contract. Further, due to another vulnerability with a different root cause (the ChoosingRam::increaseValuesOfParticipants
function does not check if the challenged user is the same as the challenger) the users will be able to challenge themselves and easily to become Ram. Even if the other vulnerability is fixed, the reported in this finding is still valid. It allows user who has not paid the entrance fee to become Ram and to get the Ram reward.
Manual review
Add checks for who is allowed to execute RamNFT::mintRamNFT
in a similar way to the one for RamNFT::updateCharacteristics
but this time for the Dussehra
contract. See the code below.
Then you should use ramNFT.setDussehraContract(address(dussehra));
to set the address of the deployed Dussehra
contract such like using the ramNFT.setChoosingRamContract(address(choosingRam));
to set the address of the ChoosingRam
contract.
The code below is a test which proves that with this changes no one other than the Dussehra
contract can mint RamNFT
.
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.