Missing Transfer Ownership Pattern #62
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Warden finding
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Handle
leastwood
Vulnerability details
Impact
Factory.sol
inherits Openzeppelin'sOwnable
contract which is used to restrict certain functions to a specific owner account. By default, the owner account is set to the deployer ofFactory.sol
. However, the owner can transfer ownership of this contract by callingtransferOwnership()
with thenewOwner
as input. If the current owner of the contract mistakenly transfers ownership to an account that is not actively controlled, the ownership ofFactory.sol
will be lost.Proof of Concept
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
Tools Used
Manual code review.
Recommended Mitigation Steps
Consider implementing a proper transfer ownership pattern whereby the current owner nominates a new owner. This new owner then has to claim ownership for the change to be applied. This can be done by overriding the current
Ownable
implementation oftransferOwnership()
and adding aclaimOwnership()
function alongside it.The text was updated successfully, but these errors were encountered: