Description: In function EggHuntGame::endGame
it is only checked if the game is active, but not if the duration meant for the game has passed since the game has started.
Impact: The owner of the game can end the game whenever he wants to, even if the duration of the game that was set hasn't passed.
Proof of Concept:
Onwer starts the game with a certain duration
Owner ends the game before the duration has passed
Put this in the EggHuntGameTest.t.sol
:
Recommended Mitigation: Easiest fix is to add a require
at the start of the function to check whether set duration has passed.
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.