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

Crucial setter functions lack checks for valid inputs #243

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

Crucial setter functions lack checks for valid inputs #243

code423n4 opened this issue May 24, 2022 · 4 comments
Labels
bug Something isn't working 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 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/4989a2077546a5394e3650bf3c224669a0f7e690/convex-platform/contracts/contracts/Booster.sol#L128-L153
https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/convex-platform/contracts/contracts/VoterProxy.sol#L83-L87

Vulnerability details

Impact

Several important setter functions lack checks to determine the parameters' validity. The malicious or accidental use of incorrect parameters may lead to unwanted results. The vulnerabilities have been split into two categories depending on their effects.

-Category 1: Incorrect inputs can lead to frozen or stolen funds
-Category 2: Incorrect inputs can lead to DoS of major protocol functionality

Proof of Concept

Category 1:

-Booster.setOwner() has no zero address check. If it is accidentally set to address(0), updating voting delegate will not be possible. Secondly the shutdownSystem() function will be be inaccessible in case of an attack. Lastly, withdrawing (through _withdraw()) will not be possible and funds will be stuck.

Category 2:

-Booster.setFeeManager has no zero address check. If address is accidentally set to zero fees (lockIncentive, stakeIncentive, earmarkIncentive, platformFee) will not be able to be updated.
-Booster.setPoolManager has no zero address check. If address is accidentally set to zero it will not be possible to add or shutdown pools. Could be dangerous in case a pool finds itself under attack.
-Booster.setVoteDelegate has no zero address check. If address is accidentally set to zero it will not be possible to cast votes on VoterProxy.sol
Booster.setTreasury has no zero address check. If it is accidentally set to zero no crv will be sent to it and will accumulate in Booster.sol.
VoterProxy.setOwner has no zero address check. If it is accidentally set to zero it will not be possible to use setRewardDeposit, setSystemConfig, setOperator and other functions. This might lead to having to redeploy the contract.

Tools Used

Manual review.

Recommended Mitigation Steps

Add checks to validate that input addresses for crucial setter functions are not 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 24, 2022
code423n4 added a commit that referenced this issue May 24, 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 28, 2022
@0xMaharishi
Copy link

Checking for address(0) is not a big deal but 2 way handshakes here would be optimal

@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 dmvt marked this as a duplicate of #31 Jun 22, 2022
@dmvt dmvt closed this as completed Jun 22, 2022
@dmvt dmvt marked this as not a duplicate of #31 Jul 11, 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, #246

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 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 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