Description:Description\
Single-Step ownership transfers are dangerous as if the transfer is made to an incorrect address, the contract will be with no owner, and the role will be lost forever.
That's why 2 step ownership transfers are preferred and recommended as best practice. They can prevent such scenarios from happening. 2-step ownership transfer gets to a "pending" state and the new owner should claim his new rights, otherwise the old owner still has control of the contract.
For Thorn, all those contracts use single step ownership transfer, and the potential issue is present. They inherit Ownable
Github username: -- Twitter username: -- Submission hash (on-chain): 0xef009bd8fdcf6d6be29e78d75ba6432831992897b61af724fda562f4f3d66527 Severity: low
Description: Description\ Single-Step ownership transfers are dangerous as if the transfer is made to an incorrect address, the contract will be with no owner, and the role will be lost forever.
That's why 2 step ownership transfers are preferred and recommended as best practice. They can prevent such scenarios from happening. 2-step ownership transfer gets to a "
pending
" state and the newowner
should claim his new rights, otherwise the oldowner
still has control of the contract.For Thorn, all those contracts use single step ownership transfer, and the potential issue is present. They inherit Ownable
StableSwapFactory
,StableSwapRouter
,StableSwapLPFactory
,StableSwapThreePoolDeployer
,StableSwapTwoPoolDeployer
,StableSwapThreePool
,StableSwapTwoPool
Attack Scenario\
Attachments
Proof of Concept (PoC) File
Revised Code File (Optional)
Use OpenZeppelin's
Ownable2Step
instead ofOwnable
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable2Step.sol