After game starts, using EggHuntGame::setEggFindThreshold(100)
Owner can increase chance for himself to 100% and win the Egg every time he plays. There must exist some restriction in which Owner doesn't have that kind of unlimited advantage because game is unplayable if owner plays.
Since the owner has no restrictions and can play the game just like the players, it is possible for him to increase his chances by changing EggHuntGame::eggFindThreshold
to 100 every time he wants to play. Then, afterward, he can run EggHuntGame::searchForEgg
multiple times and win an Egg every time because:
will always be less than 100.
Owner creates and starts a game.
Owner changes EggHuntGame::eggFindThreshold
to 100
Owner run EggHuntGame::searchForEgg
and win each time
Place following into the EggHuntGameTest.t.sol
It is simulation of PoC in which 100 out of 100 cases owner wins.
Since the owner has the ability to win every time they play, the game becomes unfair, and there is no incentive for anyone to compete if the owner participates.
VS Code: Cloned the repository locally and identified the vulnerability through manual review.
There can be 2 solutions:
First is that Owner cannot play the game. There must be placed restriction in EggHuntGame::searchForEgg
Second solution is that EggHuntGame::eggFindThreshold
shouldn't be changed while game is active, only when is incative.
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.