The mechanism used to generate a _commitHash for the RockPaperScissors::commitMove function is weak.
If a player reuses the same combination of move + salt across multiple games, the resulting commitHash will be identical. Since the commitment is public on-chain, an attacker can store known commitHash values and their corresponding moves from past games.
For example:
playerA once committed to keccak256(abi.encodePacked(Move.Rock, saltA))
The attacker previously lost to that commit with Move.Scissors, revealing the actual move.
In a future game, the attacker observes the same** commitHash** used again.
The attacker now knows** **playerA is playing Rock, and can safely commit Move.Paper to guarantee a win.
This breaks the commit-reveal secrecy model and allows strategic players or bots to front-run or script predictable wins by analyzing historical data.
Manual review
Make the salt dynamic. e.g hash with `block.timestamp`
The contract does not enforce salt uniqueness
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.