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

Open
code423n4 opened this issue Feb 5, 2022 · 5 comments
Open

QA Report #63

code423n4 opened this issue Feb 5, 2022 · 5 comments
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

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-02-concur/blob/main/contracts/ConvexStakingWrapper.sol#L179
https://github.com/code-423n4/2022-02-concur/blob/main/contracts/ConvexStakingWrapper.sol#L182

Vulnerability details

Impact

ERC20 implementations are not always consistent. Some implementations of transfer and transferFrom could return ‘false’ on failure instead of reverting. It is safer to wrap such calls into require() statements or use safe wrapper functions implementing return value/data checks to handle these failures.

It is observed safeTransfer() is being used in the withdraw function, this should be replicated in the _calcRewardIntegral function

Proof of Concept

Unsafe transfer calls were found in the following locations:

  1. https://github.com/code-423n4/2022-02-concur/blob/main/contracts/ConvexStakingWrapper.sol#L179

  2. https://github.com/code-423n4/2022-02-concur/blob/main/contracts/ConvexStakingWrapper.sol#L182

Tools Used

  1. Manual Analysis

Recommended Mitigation Steps

Check the return value and revert on 0/false or use safeTransfer OpenZeppelin’s SafeERC20 wrapper functions.

@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 5, 2022
code423n4 added a commit that referenced this issue Feb 5, 2022
@r2moon r2moon added the duplicate This issue or pull request already exists label Feb 18, 2022
@GalloDaSballo
Copy link
Collaborator

Dup of #165

@JeeberC4 JeeberC4 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 Apr 21, 2022
@JeeberC4
Copy link

Adding to QA Report #81

@GalloDaSballo
Copy link
Collaborator

Finding is valid

@GalloDaSballo
Copy link
Collaborator

1

@JeeberC4 JeeberC4 removed the duplicate This issue or pull request already exists label Apr 28, 2022
@JeeberC4
Copy link

Generating as QA Report as warden's actual QA Report was invalidated by judge. Preserving original title: Unhandled return value of transfer in ConvexStakingWrapper

@JeeberC4 JeeberC4 reopened this Apr 28, 2022
@JeeberC4 JeeberC4 changed the title Unhandled return value of transfer in ConvexStakingWrapper QA Report Apr 28, 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
Projects
None yet
Development

No branches or pull requests

4 participants