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

QA Report #3

Open
code423n4 opened this issue Jun 16, 2022 · 3 comments
Open

QA Report #3

code423n4 opened this issue Jun 16, 2022 · 3 comments
Assignees
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax valid

Comments

@code423n4
Copy link
Contributor

owner can sweep all funds

description

the owner can withdraw all tokens from NestedFactory.sol with no timelock

To give more trust to users: this function should be put behind a timelock.

https://github.com/code-423n4/2022-06-nested/blob/b4a153c943d54755711a2f7b80cbbf3a5bb49d76/contracts/NestedFactory.sol#L175-L179

use of magic numbers

description

constants should be declared rather than use magic numbers

findings

https://github.com/code-423n4/2022-06-nested/blob/b4a153c943d54755711a2f7b80cbbf3a5bb49d76/contracts/NestedFactory.sol#L264
https://github.com/code-423n4/2022-06-nested/blob/b4a153c943d54755711a2f7b80cbbf3a5bb49d76/contracts/NestedFactory.sol#L378
https://github.com/code-423n4/2022-06-nested/blob/b4a153c943d54755711a2f7b80cbbf3a5bb49d76/contracts/NestedFactory.sol#L443

fees could be zero

description

this could happen when exitFees has not been initialized yet by calling setExitFees(), exitFees will be zero which makes amountFees zero

for small amounts of amountBought, amountFees could round down to zero due to division by 10000

findings

https://github.com/code-423n4/2022-06-nested/blob/b4a153c943d54755711a2f7b80cbbf3a5bb49d76/contracts/NestedFactory.sol#L264

fees can be set with no time lock

description

fees can be set to 100% with no time lock

a malicious admin can front run transactions by setting fee to 100% to steal funds

recommend adding a timelock to this function

https://github.com/code-423n4/2022-06-nested/blob/b4a153c943d54755711a2f7b80cbbf3a5bb49d76/contracts/NestedFactory.sol#L167-L172

No Transfer Ownership Pattern

description

Recommend considering implementing a two step process where the owner nominates an account and the nominated account needs to call an acceptOwnership() function for the transfer of ownership to fully succeed. This ensures the nominated EOA account is a valid and active account.

findings

https://github.com/code-423n4/2022-06-nested/blob/b4a153c943d54755711a2f7b80cbbf3a5bb49d76/contracts/abstracts/OwnableProxyDelegation.sol#L56-L59

missing checks for zero address

description

Checking addresses against zero-address during initialization or during setting is a security best-practice. However, such checks are missing in address variable initializations/changes in many places.

Impact: Allowing zero-addresses will lead to contract reverts and force redeployments if there are no setters for such address variables.

findings

https://github.com/code-423n4/2022-06-nested/blob/b4a153c943d54755711a2f7b80cbbf3a5bb49d76/contracts/operators/Yearn/YearnCurveVaultOperator.sol#L48-L50

@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels Jun 16, 2022
code423n4 added a commit that referenced this issue Jun 16, 2022
@maximebrugel maximebrugel self-assigned this Jun 16, 2022
This was referenced Jun 18, 2022
@obatirou
Copy link
Collaborator

owner can sweep all funds (disputed)

There is a timelock, see ownership documentation in readme

@Yashiru
Copy link
Collaborator

Yashiru commented Jun 24, 2022

Use of magic numbers (Duplicated)

Duplicated of #76 at 5. constants should be defined rather than using magic numbers

@Yashiru
Copy link
Collaborator

Yashiru commented Jun 24, 2022

Missing checks for zero address (Duplicated)

Duplicated of #61 at 2. Missing address(0) checks

@Yashiru Yashiru added the duplicate This issue or pull request already exists label Jun 27, 2022
@JeeberC4 JeeberC4 removed the duplicate This issue or pull request already exists label Jul 20, 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 QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax valid
Projects
None yet
Development

No branches or pull requests

6 participants