Rock Paper Scissors

First Flight #38
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: medium
Valid

Lack of replay protection in commit hashes

Summary

Commitments use keccak256(move, salt) with no unique game identifier. Risk of cross-game reuse.

Vulnerability Details

A player could reuse the same (move, salt) pair across multiple games, leading to identical hashes. Without gameId or player-specific entropy like nonce, a committed move could potentially be recognized and front-run in future games.

Impact

  • Cross-game commit replay vulnerability

  • Possible front-running or strategic leakage

Tools Used

  • Manual code review

Recommendations

Include unique identifiers in the hash.|
This ensures commitments are unique per game and player:

bytes32 commit = keccak256(abi.encodePacked(gameId, msg.sender, move, salt));
Updates

Appeal created

m3dython Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Lack of Salt Uniqueness Enforcement

The contract does not enforce salt uniqueness

Support

FAQs

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