The RockPaperScissors contract implements an admin transfer function that immediately transfers control to a new address without any verification that the new address can actually function as an admin, creating a risk of permanently losing admin access.
The setAdmin
function performs an immediate transfer of admin rights:
While this function does check that the new admin is not the zero address, it has these critical security issues:
The transfer happens in a single transaction with no confirmation
There's no verification that the new address can actually access its private keys
A simple typo in the address could result in permanent loss of admin control
There's no time-delay to allow recovery if the transfer was unintended
This vulnerability can lead to:
Permanent loss of admin control if the address is mistyped
Inability to withdraw protocol fees
No way to update protocol parameters
Contract becoming effectively immutable if admin access is lost
Manual code review
Implement a two-step ownership transfer pattern that requires the new admin to accept the role
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.