Rock Paper Scissors

First Flight #38
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: high
Invalid

Timeout Reveal Abuse (Griefing Attack)

Timeout Reveal Exploitation (Griefing Attack)

Summary:


If one player commits but refuses to reveal their move, the other player can use the timeoutReveal() function after the timeout expires to claim a win unfairly. This enables griefing attacks where a dishonest player manipulates the game outcome.


Vulnerability Details:
The timeoutReveal() function allows the first player who calls it to claim victory if the other player hasn't revealed. Since there is no penalty or refund for the honest player who revealed, malicious actors can exploit this to win by simply refusing to reveal their own moves.

Code Snippet:

function timeoutReveal(uint256 _gameId) external {
Game storage game = games[_gameId];
require(block.timestamp > game.revealDeadline, "Reveal period not over");
if (!game.player1Revealed) {
game.winner = game.player2;
} else if (!game.player2Revealed) {
game.winner = game.player1;
}
// Payout logic
}

Impact:
Dishonest players can intentionally avoid revealing, leading to unfair wins, player frustration, and undermining trust in the platform.


Tools Used:

  • Solidity

  • VS Code


Recommendations:
Introduce penalties for players who don't reveal (e.g., partial refund to the honest player).
Alternatively, split the staked bet between both players if neither reveals.

Updates

Appeal created

m3dython Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

Timeout Mechanism Functionality

The player who fails to reveal their move within the deadline forfeits the game to the opponent who did reveal

m3dython Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

Timeout Mechanism Functionality

The player who fails to reveal their move within the deadline forfeits the game to the opponent who did reveal

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.