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

Anyone can become `ram`

Summary

Anyone can become ram

Vulnerability Details

One can be called ram when they fulfill isJitaKrodhah, isDhyutimaan, isVidvaan, isAatmavan, isSatyavaakyah. We can now see the snippet below

if (ramNFT.getCharacteristics(tokenIdOfChallenger).isJitaKrodhah == false){
ramNFT.updateCharacteristics(tokenIdOfChallenger, true, false, false, false, false);
} else if (ramNFT.getCharacteristics(tokenIdOfChallenger).isDhyutimaan == false){
ramNFT.updateCharacteristics(tokenIdOfChallenger, true, true, false, false, false);
} else if (ramNFT.getCharacteristics(tokenIdOfChallenger).isVidvaan == false){
ramNFT.updateCharacteristics(tokenIdOfChallenger, true, true, true, false, false);
} else if (ramNFT.getCharacteristics(tokenIdOfChallenger).isAatmavan == false){
ramNFT.updateCharacteristics(tokenIdOfChallenger, true, true, true, true, false);
} else if (ramNFT.getCharacteristics(tokenIdOfChallenger).isSatyavaakyah == false){
ramNFT.updateCharacteristics(tokenIdOfChallenger, true, true, true, true, true);
selectedRam = ramNFT.getCharacteristics(tokenIdOfChallenger).ram;
}

The code checks each of the attributes in Challenger characteristics, let's say the challenger has all the attributes false at the beginning and successfully calls this function 5 times without getting to update Other people attributes (tokenIdOfAnyPerticipent, random == 1). Calling it the first time with all attributes false, will update the attribute of isJitaKrodhah to true, the second call would update the isDhyutimaan resulting in 2 trues and 3 falses, until the last 5th call it will finally update the isSatyavaakyah to true and finally all 5 of them became true, making the address eligible of becoming ram

Impact

anyone who successfully calls increaseValuesOfParticipants and updates their status 5 times (assuming they all have 5 false at the beginning) will be qualified to become ram.

Tools Used

Manual Analsysis

Recommendations

It is better to add some criteria to be able to update their status even if it's random. The random variable actually is nice but it will lead to unauthorized attribute update if it ends up resulting in 1, maybe add another if(random == X) { then update challenger attributes}, with X not equals to 0 or 1.

Updates

Lead Judging Commences

bube Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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