A vulnerability exists in the RockPaperScissors.sol
where Player B's position can be overwritten by another player after joining a game, resulting in loss of deposited ETH with no refund mechanism.
Initial State:
Game created by Player A with ETH deposit
Game state remains "Created" after Player B joins
Step 1:
Bob joins as Player B and deposits 1 ETH
Game state remains "Created"
Step 2:
Mallory calls joinGameWithEth() for same game
Overwrites Bob's position without refunding his ETH
Outcome:
Bob loses 1 ETH with no refund mechanism
ETH remains locked in contract
Mallory becomes new Player B
Direct loss of user funds
No recovery mechanism for overwritten players
Contract accumulates unrecoverable ETH
Can be used for griefing attacks
Manual Review
Change game state after Player B joins
Consider adding refund mechanism for overwritten players
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.