The game state in the _determineWinner()
function is incorrectly set to GameState.Committed
after each round, rather than reverting to GameState.Created
. This can lead to unintended game flow behavior.
In the provided code snippet, the game state transitions directly to GameState.Committed
after each round, assuming the current turn is less than the total number of turns:
However, if a player chooses not to commit their move, the revealDeadline
is not reinitialized:
As a result, a player can successfully call the timeoutReveal
function to end the game prematurely.
This vulnerability allows a player to:
Force a win by committing a move then calling timeoutReveal
and winning the game due to the opponent failing to reveal their move (which should not happen before committing).
Cancel the game unfairly by triggering a timeout, even if they haven’t completed the required game actions.
After each turn, reset the game.state
back to GameState.Created
:
Code suggestions or observations that do not pose a direct security risk.
Code suggestions or observations that do not pose a direct security risk.
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.