A period of time exists where block stuffing can be abused to prevent Dussehra::killRavana from being executed within its time constraints, resulting in timestamp checks ALWAYS failing. This guarantees calls to Dussehra::killRavana and Dussehra::withdraw revert, preventing intended users from receiving ETH and permanently locking funds in the contract.
A specific series of events must occur for the Dussehra::killRavana and Dussehra::withdraw functions to be callable and send their designated users ETH.
The series of events is as follows (as currently implemented; all timestamps are in UTC):
selectRamIfNotSelected MUST be called before or at Sun Oct 13 2024 00:00:00
This sets isRamSelected to true (increaseValuesOfParticipants currently DOES NOT set this value)
isRamSelected is required to pass the RamIsSelected modifier on killRavana and withdraw
killRavana MUST be called before or at Sun Oct 13 2024 00:01:09
This sets IsRavanKilled to true
withdraw can now be called, at any time, because isRamSelected and IsRavanKilled are set to true.
However, if the organiser calls selectRamIfNotSelected at the latest possible time (Sun Oct 13 2024 00:00:00), there exists a one minute and ten second period where killRavana MUST be called, otherwise killRavana will ALWAYS revert due to timestamp checks. Furthermore this prevents IsRavanKilled from being set to true, and prevents ALL withdraw calls from succeeding (no matter the time).
A malicious user can abuse this by stuffing blocks for the one minute and ten seconds period, preventing the ANY killRavana calls (since it is a public function) being included in a block and executed.
Add the following test case to Dussehra.t.sol:
Then, run the test:
After the block stuffing has occurred, funds intended for BOTH the organiser AND selected selectedRam are permanently locked in the contract.
Manual Review
Greater-than timestamp checks in both selectRamIfNotSelected and killRavana should be removed to allow them to be called at any time in the future, preventing funds from becoming permanently locked.
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.