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

Possible loss of ownership #85

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

Possible loss of ownership #85

code423n4 opened this issue May 16, 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 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.dev/code-423n4/2022-05-aura/blob/90e63758c023af079b5347a08b006ad0e0730ab3/contracts/AuraStakingProxy.sol#L116-L117

Vulnerability details

Impact

It's possible to lose the ownership under specific circumstances.

Proof of Concept

The ownership change logic of the AuraStakingProxy contract implements an incorrect ACK system, since the user who has to call the applyPendingOwner method is the previous owner of the contract. So if the owner delegates the property to a third party, and immediately loses the key, or dies. The property change cannot be carried out due to the logic error described above.

Source code:

Recommended Mitigation Steps

Change the require to be like:

+        require(msg.sender == pendingOwner, "!auth");
-        require(msg.sender == owner, "!auth");
-        require(pendingOwner != address(0), "invalid owner");
@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 16, 2022
code423n4 added a commit that referenced this issue May 16, 2022
@0xMaharishi 0xMaharishi added duplicate This issue or pull request already exists disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) 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

Duplicate of #102 and many more. Also should be 0 or 1

@dmvt
Copy link
Collaborator

dmvt commented Jun 20, 2022

I disagree with the sponsor. As noted, this could lead to a loss of ownership which would be very bad. Issue stands.

@dmvt dmvt removed the duplicate This issue or pull request already exists label Jul 8, 2022
@dmvt
Copy link
Collaborator

dmvt commented Jul 11, 2022

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

@dmvt dmvt closed this as completed Jul 11, 2022
@dmvt dmvt added invalid This doesn't seem right 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 invalid This doesn't seem right labels Jul 11, 2022
@dmvt
Copy link
Collaborator

dmvt commented Jul 11, 2022

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

@dmvt dmvt added the duplicate This issue or pull request already exists label Jul 11, 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 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