Players are able to join any Token game that is in the Created
GameState, without providing any ETH or RPSW.
RockPaperScissors::joinGameWithEth(uint256 _gameId)
does not check that the game retrieved via _gameId
has a bet amount of greater than zero. A bet amount of greater than zero would indicate an ETH game.
Instead, RockPaperScissors::joinGameWithEth(uint256 _gameId)
checks that the msg.value
is equivalent to the bet amount. Token games always have a bet amount of zero, therefore players can join by betting zero ETH.
Consider the following Proof of Code:
If RPSW is supposed to represent or hold monetary value, the implications of this vulnerability are quite severe, as it allows a malicious actor to take part in Token games risk-free. The malicious actor either wins RPSW or loses nothing.
Manual Review.
It is recommended to check for a bet amount greater than zero in RockPaperScissors::joinGameWithEth(uint256 _gameId)
as shown in the example below:
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.