Dussehra::killRavana
allows the kill Ravana and set IsRavanKilled
to true, but still it can be called several times as it lags the implementation to check whether Ravana is already killed.
Also killRavana
can be called by anyone, thus anyone calling killRavana
will make organizer to receive more rewards that was allocated for Ram, and as a result of which Ram will not receive their reward.
The vulnerability is present in the killRavana
function where it allows anyone to call it several times even if Ravana was already killed once.
It sets IsRavanKilled
to true, but doesn't check whether IsRavanKilled
is true, which results in allowing anyone to call it multiple times.
The function allocates 50% reward for Organizer and 50% for Ram, but calling it the second time will send the remaining 50% award of Ram to the Organizer, due to the reason that it can be called several times due to missing check to only allow to call it once by checking IsRavanKilled
value.
Organizer will get all the rewards that was allocated for Ram.
Add the test in the file: test/Dussehra.t.sol
Run the test:
Manual Review, Unit Test in Foundry
Allow the killRavana
function to be callable only a single time, by checking the IsRavanKilled
variable value as below.
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.