Rock Paper Scissors

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

Ownership transfer occurs in a single transaction

Summary

The current admin is able to set a new admin without confirmation by utilizing RockPaperScissors::setAdmin(address _newAdmin)

Vulnerability Details

Accidental transfer of ownership is more likely to occur without a confirmation step e.g. the function could be accidentally called in a UI, or the provided address could be incorrect.

Impact

If an incorrect address is provided for the new admin, the RockPaperScissors contract is immediately and irrevocably owned by the provided address. This will lock the old admin out of functions like setAdmin and withdrawFees

Tools Used

Manual Review.

Recommendations

It is recommended to utilize the @openzeppelin/contracts/access/Ownable2Step.sol contract which requires the new admin to confirm transfer and allows for cancelling transfer. These extra steps greatly reduce the likelihood of an accidental transfer of ownership to an incorrect party.

Updates

Appeal created

m3dython Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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