Summary: In RockPaperScissors::joinGameWithEth
and RockPaperScissors::joinGameWithToken
after a player joined a game by giving a bet money or token there is no prevention to protect the joined player from getting replaced, so other players can just join the game and replace the original player who joined the game causing them to not participate in the game and loose their bet money or token to the protocol.
Vulnerability Details: No checks for existing joined players to not get replaced
Impact: Joined Players will be replaced causing them to not participate in the game and loosing their asset
Proof of Concept:
player join the game
other players just come and replace them by joining the game
this vicious cycle could continue
Proof of Code: add this code to your RockPaperScissorsTest.t.sol test suit
Tools Used: Manual Review
Recommendation: Adding a line to checks if there is a player already joined or not prevents this bug from happening
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.