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 #154

Open
code423n4 opened this issue May 22, 2022 · 1 comment
Open

QA Report #154

code423n4 opened this issue May 22, 2022 · 1 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

Comments

@code423n4
Copy link
Contributor

[Low-01] AuraVestedEscrow: FRONT-RUNNABLE fund()

Impact

In AuraVestedEscrow contract, the fund function was missing access controls, allowing any user to fund the contract. By front-running the contract deployers to fund the contract, the incorrect parameters may be supplied, leaving the contract needing to be redeployed.

Proof of Concept

https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/contracts/AuraVestedEscrow.sol#L95-L110

Tools Used

None

Recommended Mitigation Steps

Add the following code to the fund function

require(msg.sender == admin, "!auth");

[Low-02] burn function could burn tokens of any user

Impact

Same as code-423n4/2021-11-overlay-findings#22, the operator could burn any amount of tokens of any user.

Proof of Concept

https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/convex-platform/contracts/contracts/cCrv.sol#L55-L59
https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/convex-platform/contracts/contracts/DepositToken.sol#L53-L57

Tools Used

None

Recommended Mitigation Steps

Update burn function, only the owner can burn his or approved tokens.

[Low-03] must safeapprove 0 first

Impact

The safeApprove() function cannot set a non-zero value to a non-zero value, so before safeApprove a non-zero value, you need to safeApprove 0.

Proof of Concept

https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/contracts/AuraVestedEscrow.sol#L186-L187

Tools Used

None

Recommended Mitigation Steps

Use safeApprove(_spender, 0) to set the allowance to zero immediately before each of the existing safeApprove() calls.

[Low-04] The length of poolInfo needs to be limited

Impact

When the length of poolInfo is too large, the massUpdatePools call may fail due to insufficient gas, which may cause the add and set function calls to fail.

Proof of Concept

https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/convex-platform/contracts/contracts/ConvexMasterChef.sol#L178-L183

Tools Used

None

Recommended Mitigation Steps

Limit the length of poolInfo

@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 May 22, 2022
code423n4 added a commit that referenced this issue May 22, 2022
@0xMaharishi
Copy link

1 & 4 are valid, but duplicates

#174 #305

@0xMaharishi 0xMaharishi added the duplicate This issue or pull request already exists label May 26, 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 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
Projects
None yet
Development

No branches or pull requests

2 participants