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

_setGovernance should be two step process #3

Closed
code423n4 opened this issue Feb 10, 2022 · 2 comments
Closed

_setGovernance should be two step process #3

code423n4 opened this issue Feb 10, 2022 · 2 comments
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-02-aave-lens/blob/main/contracts/core/LensHub.sol#L850-L854

Vulnerability details

Impact

Same as code-423n4/2021-11-bootfinance-findings#35.

The current governanceship transfer process involves the current governance calling setGovernance(). This function write the new governance's address into the _governance state variable. If the nominated EOA account is not a valid account, it is entirely possible the governance may accidentally transfer governanceship to an uncontrolled account, breaking all functions with the onlyGov() modifier.

Proof of Concept

https://github.com/code-423n4/2022-02-aave-lens/blob/main/contracts/core/LensHub.sol#L850-L854

https://github.com/code-423n4/2022-02-aave-lens/blob/main/contracts/core/modules/ModuleGlobals.sol#L94-L99

Tools Used

None

Recommended Mitigation Steps

Implement zero address check and consider implementing a two step process where the governance nominates an account and the nominated account needs to call an acceptGovernance() function for the transfer of governanceship to fully succeed. This ensures the nominated EOA account is a valid and active account.

@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 Feb 10, 2022
code423n4 added a commit that referenced this issue Feb 10, 2022
@Zer0dot
Copy link
Collaborator

Zer0dot commented Feb 10, 2022

This is a widely known design pattern that we opted not to go with. Governance is expected to be a timelock and thus the security concern is on the governance executor, not this contract. In other words, if we fuck it up, we deserve it.

@0xleastwood
Copy link
Collaborator

0xleastwood commented Apr 4, 2022

As per the sponsor's comment, I agree with the dispute. Governance mis-using a function isn't a concern, especially when a timelock is used.

@0xleastwood 0xleastwood added invalid This doesn't seem right and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue labels Apr 4, 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 invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

4 participants