In RockPaperScissors
contract, there is a lack of a timeoutCommit
function. Malicious A can create a game and wait for player B to join. Then, player A refuses to commit a move. Since only the game creator (player A) can cancel the game, player B's funds are stuck and the game state is also stuck. There is no benefit for player A, this is just a griefing attack on player B.
The following is the attack path
Malicious player A creates game and wait for player B to join
Player A refuses to commit a move
Player B cannot cancel the game
Place the following into RockPaperScissorsTest.t.sol
and run
forge test --mt testPlayerBCannotCancelGame
Impact: High, player B funds are stuck, game is stuck
Likelihood: Low, no benefit to player A as player A's funds are stuck as well in this griefing attack
Severity: Medium
Manual review
Implement a timeoutCommit
function to cancel the game after a timeout
duration if either player does not commit a move.
Protocol does not provide a way for Player B to exit a game and reclaim their stake if Player A stops participating
Protocol does not provide a way for Player B to exit a game and reclaim their stake if Player A stops participating
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.