Rock Paper Scissors

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

Commitment hash is malleable

Summary

Use of abi.enocdePacked is risky since it can cause hash collision.

keccak256(abi.encodePacked(move, _salt));

Vulnerability Details

We are packing the values tightly, which means different combinations of move and salt** can result in the same byte stream**, leading to hash collisions if the types aren’t fixed length.

Impact


abi.encodePacked(uint8(1), "23") == 0x0132
abi.encodePacked(uint8(18), "3") == 0x123
Hex 0x0132 == 0x123

Tools Used
Forge

Recommendations
Use abi.enocde instead of abi.enocdePacked

Updates

Appeal created

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

Support

FAQs

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