Helpful Peach Caribou
Medium
The HatsSignerGate
contract does not implement a mechanism to unlock the contract once it is locked.
##Vulnerability Details
The vulnerabilities that arise are as follows:-
- If the owner locks the contract for any purpose, such as to disable a specific function, it cannot be unlocked later because no unlocking mechanism has been implemented.
- If the contract is locked for any purpose or function, the
migrateToNewHSG
function will also be locked, making migration to a new HSG impossible, because themigrateToNewHSG
function check that contract is locked or not.
Once the contract is locked it will never be unlocked and the migration to other HSG will also not be possible.
Implement a new unlock function in the contract .
locked
is a global storage variable already defined in the contract.
The Following chnages in the HatsSignerGate
contract.
function unLock() public {
_checkOwner();
_unlock();
}
function _unlock() internal {
locked = false;
emit HSGunLocked();
}
And in the IHatsSignerGate
interface
event HSGunLocked();