The EggHuntGame::startGame
function only implements a minimum duration check (MIN_GAME_DURATION
) but lacks a maximum duration limit. This allows the game owner to set arbitrarily long game durations, potentially leading to unintended game states and timestamp overflow risks.
Current implementation in EggHuntGame::startGame
:
The vulnerability allows:
Setting extremely long game durations (up to type(uint256).max
)
Creating games that could run for years or decades
Potential timestamp overflow if block.timestamp + duration
exceeds type(uint256).max
Example exploitation:
Games could remain active indefinitely
Difficulty in managing game states
Potential timestamp overflow risks
Confusion for players about game duration
Possible interference with future game iterations
. Implement a maximum duration limit:
Additional recommendations:
Add ability to extend/reduce game duration within bounds
Implement game phases for longer tournaments
Add emergency game end functionality
Consider using OpenZeppelin's SafeMath for timestamp calculations
Add events for duration modifications
Owner is trusted and is not expected to interact in ways that would compromise security
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.