The Game::claimThrone()
function allows new players to claim the throne even after the grace period has elapsed. As a result, the game never truly ends until Game::declareWinner
is called.
There is no check inside Game::claimThrone()
to verify whether the current timestamp has exceeded the lastClaimTime + gracePeriod, which should signal the game's conclusion.
The modifier gameNotEnded
only checks the gameEnded
boolean — but since gameEnded
is never automatically updated based on time, the condition never becomes true
even when the grace period expires.
This allows players to indefinitely restart the game, as long as Game::declareWinner()
is called.
Likelihood:
Reason 1 : Throne can be claimed both during and after the grace period has elapsed
Impact:
The game can srun infintely if no winner is declared to mark the end of the game
This vulnerability is a seriousviolation of the game policy and mechanics, as the rightful king may not be preserved after the grace period has elapsed
Update the Game::claimThrone()
so that it checks if the grace period has elapsed before a new player can claim throne.
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.