Dussehra::killRavana
function can be called multiple times to send all the funds in the event to the organiser
Description: The Dussehra:killRavana
function allows participants to kill Ravana and this function must be called before Ram
can claim the rewards of the event via the Dussehra::withdraw
function. When this function is called, it will send half of the total amount collected to the organiser
. The problem arises from the fact that this function is public and it can be called by anyone multiple times, in which case all the funds of the event will go towards the organiser
's address.
Impact: Organiser can steal all the funds from the contract or a malicious user can call the function twice to purposefully send all the funds of others to the organiser
address.
Proof of Concepts: Input the test below in the Dussehra.t.sol
file.
Test output
Recommended mitigation: Add another check in the Dussehra:killRavana
function that will revert if IsRavanKilled = true;
. Like this you will ensure that the function can only be called once.
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.