Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

engineer - VaultFactory despite importing Ownable2Step is not inheriting from it thereby leaving the owner transfership mechanism vulnerable #155

Open
sherlock-admin4 opened this issue Sep 21, 2024 · 0 comments

Comments

@sherlock-admin4
Copy link

sherlock-admin4 commented Sep 21, 2024

engineer

Medium

VaultFactory despite importing Ownable2Step is not inheriting from it thereby leaving the owner transfership mechanism vulnerable

Summary

  1. VaultFactory imports Ownable2Step as seen here.
  2. VaultFactory inherits from Ownable as seen here
  3. This results in the ownership transfer mechanism to rely on Ownable instead of much safer Ownable2Step.

Vulnerability Detail

Single-step ownership transfer means that if a wrong address was passed when transferring ownership or admin rights it can mean that role is lost forever. The ownership pattern implementation for the protocol is in OpenZeppelin's Ownable.sol where a single-step transfer is implemented. This can be a problem for all methods marked in onlyOwner throughout VaultFactory contract, some of which are core contract functionality.

Impact

High, because important protocol functionality will be bricked

Likelihood

Low, because an error or mistake on the admin's end will cause this

Code Snippet

-   contract VaultFactory is ILidoVaultInitializer, Ownable {
+   contract VaultFactory is ILidoVaultInitializer, Ownable2Step {

Tool used

Manual Review

Recommendation

It is a best practice to use two-step ownership transfer pattern, meaning 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. Consider using OpenZeppelin's Ownable2Step contract.

See Code Snippet section above for the recommended solution.

@sherlock-admin4 sherlock-admin4 changed the title Old Violet Salamander - VaultFactory despite importing Ownable2Step is not inheriting from it thereby leaving the owner transfership mechanism vulnerable engineer - VaultFactory despite importing Ownable2Step is not inheriting from it thereby leaving the owner transfership mechanism vulnerable Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant