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

Use two steps in order to change the uberOwner #69

Closed
code423n4 opened this issue Jun 16, 2021 · 2 comments
Closed

Use two steps in order to change the uberOwner #69

code423n4 opened this issue Jun 16, 2021 · 2 comments
Labels
2 (Med Risk) bug Something isn't working duplicate This issue or pull request already exists

Comments

@code423n4
Copy link
Contributor

Handle

a_delamo

Vulnerability details

Impact

In all three contracts (RCFactory, RCOrderbook and RCTreasury) in order to apply or execute important changes/functionalities, you need to be the uberOwner.

In order to change the uberOwner, you would execute the following method:

    function changeUberOwner(address _newUberOwner) external {
        require(msgSender() == uberOwner, "Extremely Verboten");
        require(_newUberOwner != address(0));
        uberOwner = _newUberOwner;
    }

If the wrong address would be introduced, it would make the contract unusable.

Recommended Mitigation Steps

I would recommend using a two steps process. This way we would protect for human errors.

    address public uberOwner;
   address public proposedUberOwner;

    function proposeNewUberOwner(address _newUberOwner) external {
        require(msgSender() == uberOwner, "Extremely Verboten");
        require(_newUberOwner != address(0));
        proposedUberOwner= _newUberOwner;
    }

   function becomeUberOwner() external {
        require(msgSender() == proposedUberOwner, "Extremely Verboten");
        uberOwner = proposedUberOwner;
        proposedUberOwner = address(0);
   }
@code423n4 code423n4 added 1 (Low Risk) bug Something isn't working labels Jun 16, 2021
code423n4 added a commit that referenced this issue Jun 16, 2021
@Splidge Splidge added the duplicate This issue or pull request already exists label Jun 17, 2021
@Splidge
Copy link
Collaborator

Splidge commented Jun 17, 2021

Duplicate of #5

@Splidge Splidge marked this as a duplicate of #5 Jun 17, 2021
@Splidge Splidge closed this as completed Jun 17, 2021
@dmvt
Copy link
Collaborator

dmvt commented Jul 11, 2021

duplicate of #105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants