Dussehra::killRavana
Description:
The killRavana
function in the Dussehra
contract can be invoked multiple times, either by design or due to unclear documentation. This repeated invocation leads to the organizer receiving the remaining rewards upon subsequent calls, thereby depleting the contract's balance. As a result, the intended recipient (Ram) is unable to withdraw their rewards due to insufficient funds in the contract.
Impact:
This vulnerability prevents the rightful winner from receiving their rewards, redirecting the funds to the organizer instead. This not only affects the fairness of the reward distribution but also introduces a potential denial-of-service (DoS) condition where the withdrawal functionality becomes unusable for the intended beneficiary.
Proof of Concept:
The following test case can be added to the existing test suite to demonstrate this vulnerability:
Tools Used:
Manual Review
Recommended Mitigation:
To mitigate this vulnerability, it is advisable to add a check within the killRavana
function to prevent it from being called more than once. This can be achieved by introducing a state variable that tracks whether Ravana has already been killed and reverting the transaction if an attempt is made to call the function again.
Here is the proposed modification to the killRavana
function:
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.