The joinGameWithEth
and joinGameWithToken
functions allow a user to join a game if the game.state is GameState.Created. However, the game.state is never updated to
GameState.Joined` or similar after playerB joins. As a result, anyone can re-call the joinGame function on an already joined game and overwrite playerB with a new address, as long as the join conditions still pass.
// Alice creates game with ID 1
// Bob joins game ID 1
// Now Charlie is playerB
, overwriting Bob's original slot
PlayerB can be overwritten after the game is already joined.
A malicious actor could front-run legitimate joiners to hijack games.
Original playerB may have already sent funds or transferred tokens.
This can lead to funds being misassigned, griefing, and broken trust in the match system.
Update the game state once playerB joins. For example:
This prevents subsequent joins after a game is filled.
Game state remains Created after a player joins
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.