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

increaseValuesOfParticipants doesn't turn isRamSelected as true when selecting Ram

Summary

Lack of updating ChoosingRam::isRamSelected variable in the ChoosingRam::increaseValuesOfParticipants function allows for overwriting players as Ram, because the ChoosingRam::RamIsNotSelected modifier is not triggered.

Vulnerability Details

After updating all characteristics of a Ram NFT with ChoosingRam::increaseValuesOfParticipants and getting stored as ChoosingRam::selectedRam, there's no updating ChoosingRam::isRamSelected to true, which allows for other calls to ChoosingRam::increaseValuesOfParticipants to the highest update to overwrite the players address as ChoosingRam::selectedRam.

Impact

No player is assured its victory, even when being selected as Ram, which breaks the purpose of the protocol.

Tools Used

Manual review

Recommendations

Add isRamSelected = true; after both selectedRam = ramNFT.getCharacteristics(tokenIdOfChallenger).ram; lines in the ChoosingRam::increaseValuesOfParticipants function.

Updates

Lead Judging Commences

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

`isRamSelected` is not set

Support

FAQs

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