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

safeApprove may revert #10

Closed
code423n4 opened this issue Jun 9, 2022 · 4 comments
Closed

safeApprove may revert #10

code423n4 opened this issue Jun 9, 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

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-06-connext/blob/4dd6149748b635f95460d4c3924c7e3fb6716967/contracts/contracts/core/connext/libraries/AssetLogic.sol#L347

Vulnerability details

description

OpenZeppelin's safeApprove() will revert if the account already is approved and the new safeApprove() is done with a non-zero value

/2022-06-connext/contracts/contracts/core/connext/libraries/AssetLogic.sol
347: SafeERC20.safeApprove(IERC20(_assetIn), address(pool), _amountIn);

recommend using safeIncreaseAllowance() instead

@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 Jun 9, 2022
code423n4 added a commit that referenced this issue Jun 9, 2022
@ecmendenhall
Copy link

Duplicate of #154

@jakekidd jakekidd added the duplicate This issue or pull request already exists label Jun 26, 2022
@jakekidd
Copy link
Collaborator

Duplicate of #154

@jakekidd jakekidd marked this as a duplicate of #154 Jun 26, 2022
@0xleastwood
Copy link
Collaborator

Lacking a proper explanation of the impact this issue will have on bridge transfers and related swap mechanics. Downgrading to QA.

@0xleastwood 0xleastwood 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 Aug 13, 2022
@0xleastwood
Copy link
Collaborator

Merging with #7.

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

4 participants