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

AssetLogic :Must safeApprove 0 first #75

Closed
code423n4 opened this issue Jun 14, 2022 · 5 comments
Closed

AssetLogic :Must safeApprove 0 first #75

code423n4 opened this issue Jun 14, 2022 · 5 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-L348

Vulnerability details

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-06-connext/blob/4dd6149748b635f95460d4c3924c7e3fb6716967/contracts/contracts/core/connext/libraries/AssetLogic.sol#L347-L348

Tools Used

None

Recommended Mitigation Steps

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

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

Duplicate of #154

@jakekidd
Copy link
Collaborator

jakekidd commented Jun 26, 2022

Duplicate of #154

@jakekidd jakekidd marked this as a duplicate of #154 Jun 26, 2022
@jakekidd jakekidd added the duplicate This issue or pull request already exists label Jun 26, 2022
@0xleastwood
Copy link
Collaborator

While it is a duplicate of a more severe issue, this warden has failed to explain this properly. Downgrading to QA and merging with #74.

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

While it is a duplicate of a more severe issue, this warden has failed to explain this properly. Downgrading to QA and merging with #74.

Eh, it seems most dupes of the primary issue are similar in this sense. Might as well put them all on the same level of severity.

@0xleastwood 0xleastwood added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value and removed QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels Aug 12, 2022
@0xleastwood
Copy link
Collaborator

Upon further thought, there is no mention of impact in how funds are handled during bridge transfers. Will downgrade to QA and do the same to similar dupes of #154.

@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 12, 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

4 participants