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

New Admin is not set correctly #51

Closed
code423n4 opened this issue May 15, 2022 · 3 comments
Closed

New Admin is not set correctly #51

code423n4 opened this issue May 15, 2022 · 3 comments
Labels
bug Something isn't working disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraStakingProxy.sol#L116
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/VoterProxy.sol#L73
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraVestedEscrow.sol#L77

Vulnerability details

We will take applyPendingOwner function from AuraStakingProxy.sol#L116 in this POC

Impact

The require statement condition in applyPendingOwner function is incorrect. msg.sender should be pendingOwner and not owner. Owner might give an incorrect pendingOwner address, but a 2 step process where pendingOwner has to accept the Admin will confirm that address was correct

Proof of Concept

  1. Admin sets a new pendingOwner, by mistake he sets incorrect address for pendingOwner
  2. Unaware of the mistake, Admin calls applyPendingOwner which sets admin to this incorrect pendingOwner
  3. Now admin is controlled by an incorrect address and all admin functions cant be used

Similar occurrence

  1. This also need to be fixed in setOwner function at VoterProxy.sol#L73
  2. setAdmin function at AuraVestedEscrow.sol#L77 - It should be checked whether the new Admin is not an incorrect address(0). Also it would be better to have a 2 step approach for updating admin as if set wrong then all admin operations will halt
require(_admin!=address(0),"Incorrect address");

Recommended Mitigation Steps

function applyPendingOwner() external {
        //require(msg.sender == owner, "!auth"); // Incorrect
        require(msg.sender == pendingOwner, "!auth");
		require(pendingOwner != address(0), "invalid owner");

        owner = pendingOwner;
        pendingOwner = address(0);
    }
@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels May 15, 2022
code423n4 added a commit that referenced this issue May 15, 2022
@0xMaharishi 0xMaharishi added the sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons label May 25, 2022
@0xMaharishi
Copy link

This is definitely not a 2 risk.. 0 or 1 considering there is nothing particularly damaging happening here and it's an optimisation issue

@0xMaharishi 0xMaharishi added the disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) label May 25, 2022
@dmvt dmvt marked this as a duplicate of #85 Jun 23, 2022
@dmvt dmvt closed this as completed Jun 23, 2022
@dmvt dmvt added the duplicate This issue or pull request already exists label Jun 23, 2022
@dmvt
Copy link
Collaborator

dmvt commented Jul 11, 2022

Per #364 (comment) I have decided to downgrade this to QA.

@dmvt dmvt added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Jul 11, 2022
@dmvt
Copy link
Collaborator

dmvt commented Jul 11, 2022

Grouping this with the warden’s QA report, #47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Projects
None yet
Development

No branches or pull requests

3 participants