For an ETH game, player A should be able to cancelGame
before any player has called commitMove
. This should refund both players with their ETH bets. However, malicious player B joining the game via malicious contract can revert on receiving ETH, causing cancelGame
to fail and game state to be stuck. Importantly, player A is unable to receive their rightful refunds, breaking the protocol's intended functionality.
The attack path is as follows:
Player A creates an ETH game
Player B joins game (via malicious contract)
Player B refuses to commitMove
Player A cannot cancelGame
to receive refunds
Game state is stuck and cannot reach Cancelled
Place the following into RockPaperScissorsTest.t.sol
and run
forge test --mt testPlayerBPreventPlayerARefunds
Impact: High, player A cannot receive their refund, game state is stuck
Likelihood: Low, no benefit to malicious player B as they do not receive their refunds as well
Severity: Medium
Manual review
Use a pull-over-push approach to refund players
Malicious player wins a game using a contract that intentionally reverts when receiving ETH, the entire transaction will fail
Malicious player wins a game using a contract that intentionally reverts when receiving ETH, the entire transaction will fail
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.