DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: low
Invalid

TransferOwnership Should Be Two Step

Summary

The current transferOwnership function allows the onlyDAO to directly set a new owner without requiring any confirmation or action from the nominated account. Implementing a two-step process for transferring ownership is recommended to ensure that the nominated account is a valid and active entity.

Vulnerability Details

The existing transferOwnership function lacks a two-step process for transferring ownership. It allows the owner or admin to immediately nominate a new owner by setting s.ownerCandidate without any further confirmation or action required from the nominated account.

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L111-L114

function transferOwnership(address newOwner) external onlyDAO {
s.ownerCandidate = newOwner;
emit Events.NewOwnerCandidate(newOwner);
}

This single-step process can be error-prone and may lead to unintended ownership transfers. There is no mechanism to verify if the nominated account is a valid and active entity.

Impact

The lack of a two-step process could potentially lead to unauthorized ownership transfers if an admin mistakenly or maliciously nominates an incorrect account.

Tools Used

Manual Review

Recommendations

Lack of two-step procedure for critical operations leaves them error-prone. Consider adding two step procedure on the critical functions.

Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Admin Input/call validation

Support

FAQs

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