The updateGracePeriod()
function allows the owner to change the gracePeriod
even while a game round is active. This can be exploited to extend or shorten the current king's reign, impacting gameplay fairness and user trust.
Risk
Likelihood:
The function is callable by the owner
at any time. No guard (e.g., gameEndedOnly
check) is in place to prevent misuse during active rounds.
Impact:
Changing the grace period mid-game can:
Prevent the rightful king from winning.
Enable malicious manipulation by the owner.
Break user trust and violate expectations of fairness and finality.
The POC demonstarate that if the owner changes the graceperiod midGame, enabling the currentKing to win.
By adding the modifier gameEndedOnly
can prevent the owner to change the gracePeriod midgame, thereby mitigating the vulnerability.
Here if we do not add the modifier also it will automatically rest for next round.
And the other option we have to add modifier.
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.