Due to insufficient validation between game types (Token vs ETH) and the use of game.bet = 0 for token games, an attacker can bypass the token requirement by calling joinGameWithEth() on a token-based game, allowing them to join without providing either tokens or ETH.
In the RockPaperScissors contract, games can be created in two modes:
Token-based games where players must provide winning tokens
ETH-based games where players must provide ETH as bets
The vulnerability exists because:
Token games set game.bet = 0 during creation
The joinGameWithEth() function only validates that the sent ETH matches game.bet
There is no explicit game type validation
Example Attack Flow:
Some users can join games for free. This breaks game economics and fairness and damages trust in the game protocol.
Foundry
Add Game Type Enumeration
Set Game Type During Creation
Validate Game Type During Join
joinGameWithEth function lacks a check to verify the game was created with ETH
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.