Description: he RockPaperScissors::timeoutReveal function is intended to handle situations where one or both players fail to reveal their committed moves after the revealDeadline. However, there is no check to ensure that game.revealDeadline has been properly set before using it in the statement:
If game.revealDeadline is still at its default value of 0 (e.g., when only one player has committed a move), this require statement will always pass, as block.timestamp will always be greater than zero. This allows any player to prematurely invoke timeoutReveal immediately after committing a move—before the opponent even has a chance to respond.
Impact: A malicious player could join multiple games, commit a move, and instantly call timeoutReveal to disrupt the game flow. While this may not result in financial loss, it can prevent legitimate gameplay, effectively acting as a denial-of-service attack against the contract’s normal operations.
Proof of Concept: Please refer to [H-1], where this exploit was also demonstrated
Recommended Mitigation: Add a validation check to ensure game.revealDeadline has been explicitly set before performing the timeout logic. This prevents the function from being abused before both players have committed their moves and the reveal phase has officially started.
timeoutReveal function incorrectly allows execution and game cancellation even when only one player has committed
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.