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

Missing init check may update operator earlier than desired #48

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

Missing init check may update operator earlier than desired #48

code423n4 opened this issue May 15, 2022 · 4 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 G (Gas Optimization) resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) 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/Aura.sol#L82

Vulnerability details

Impact

The updateOperator function should only be allowed to be called after init function otherwise operator would get updated from Aura.sol contract deployer before original operator could provide initial mint using init function

Proof of Concept

  1. Aura.sol contract is deployed and operator is currently User X
  2. User A simply calls updateOperator function which updates the operator to User Y
  3. User X now loses his operator access and cannot call init function

Recommended Mitigation Steps

Add a check in updateOperator function to confirm this

function updateOperator() public {
		require(minter!=address(0), "Init should be called before using this function");
        address newOperator = IStaker(vecrvProxy).operator();
        emit OperatorChanged(operator, newOperator);
        operator = newOperator;
    }
@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 duplicate This issue or pull request already exists sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons labels May 25, 2022
@0xMaharishi
Copy link

severity 0 or 1. Dupo of #19

@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
@0xMaharishi 0xMaharishi added the resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) label May 30, 2022
@0xMaharishi
Copy link

@dmvt
Copy link
Collaborator

dmvt commented Jun 20, 2022

I'm going to downgrade this one to a gas issue given that the worst impact is a required redeploy.

@dmvt dmvt added G (Gas Optimization) and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Jun 20, 2022
@dmvt
Copy link
Collaborator

dmvt commented Jun 25, 2022

Grouping this with the warden’s gas report, #129

@dmvt dmvt closed this as completed Jun 25, 2022
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 G (Gas Optimization) resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) 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