Description
The implementation of ChoosingRam::increaseValuesOfParticipants allows selectedRam to be set to an uninitialised CharacteristicsOfRam struct with the default address of address(0).
This would result in funds being trapped as the ability to withdraw funds is restricted by the OnlyRam modifier on the withdraw function in the Dussehra contract.
Relevant code snippet diff: ChoosingRam::increaseValuesOfParticipants
The relevant code from the Dussehra.sol contract.
Impact
Funds at risk if selectedRam is equal to address(0) as the withdraw function uses the OnlyRam modifier to check msg.sender is equal to selectedRam.
Proof of Concept
Standalone Test shown below
Test Result
Recommended mitigation
Change the validation in the function ChoosingRam::increaseValuesOfParticipants to check >= as shown below and in the diff above.
tokenIdOfChallenger >= ramNFT.tokenCounter() and
tokenIdOfAnyPerticipent >= ramNFT.tokenCounter()
References
Tools Used
Manual Review
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.