Rock Paper Scissors

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

Salt complexity not validated

Summary

It is expected that the user provides the commit generated by a salt, but there is not validation that the salt is complex enough.

Vulnerability Details

It is expected that the commit have the following format keccak256(abi.encodePacked(uint8(Move), salt)). If the salt used by the user is very weak, then the other player could try to guess the commit with brute force.

Impact

Players could use brute force to try to guess the commit hash of the move

Tools Used

Manual review

Recommendations

It would be tricky to validate the salt complexity inside the contract, but the app could provide different ways to minimize this, either with more documentation or with a client library that helps users with the generation of the hash

Updates

Appeal created

m3dython Lead Judge about 2 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.