Dussehra::killRavana can be called multiple times, leading to organiser receiving all funds and leaving no funds for the selected ram to claim through the function Dussehra::withdraw.Description: The function Dussehra::killRavana sets IsRavanKilled to true and sends half of the collected fees to the organiser address. The Dussehra::withdraw function, in turn, is meant to allow a winner address to withdraw the other half of the collected fees.
However, the killRavana function does not check if Ravana has already been killed (or, more generally, if the function has already been called before. It only checks if Ram has been selected (through the RamIsSelected modifier) and if it is called between block.timestamp 1728691069 and 1728691069. As a result, it can be called multiple times, each time transferring half of the collected fees to the organiser address.
Impact: After two calls to the killRavana function, all funds have been sent to the organiser address, leaving none for the winner address to withdraw. It breaks intended functionality of the protocol and allows the organiser to execute a rug pull.
Proof of Concept:
Participants enter the contract through the Dussehra::enterPeopleWhoLikeRam function.
Each participant pays the entry fee.
Between timestamp 1728691200 and 1728777600, the organiser calls the ChoosingRam::selectRamIfNotSelected function. This allows the killRavana function to be called.
Any address calls the Dussehra::killRavana.
A second time, any address calls the Dussehra::killRavana.
All fees deposited into the protocol end up at organiser address.
Place the following in Dussehra.t.sol.
Recommended Mitigation: Add a check if Ravana has already been killed, making it impossible to call the function twice.
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.