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

Use of unsafe transfer() #134

Closed
code423n4 opened this issue Dec 19, 2021 · 2 comments
Closed

Use of unsafe transfer() #134

code423n4 opened this issue Dec 19, 2021 · 2 comments
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working duplicate This issue or pull request already exists

Comments

@code423n4
Copy link
Contributor

Handle

p4st13r4

Vulnerability details

Impact

Contracts in the folder basket/contracts/singleJoinExit makes use of unsafe address.transfer() method.

The use of such function could have unintended outcomes on the eth being sent to the receiver. Funds can potentially be lost if:

  1. The smart contract fails to implement the payable fallback function
  2. The fallback function uses more than 2300 gas units

The latter situation may occur in the instance of gas cost changes. The impact would mean that any contracts receiving funds would potentially be unable to retrieve funds

Proof of Concept

Affected lines are here:

  • contracts/basket/contracts/singleJoinExit/EthSingleTokenJoin.sol:37
  • contracts/basket/contracts/singleJoinExit/EthSingleTokenJoinV2.sol:37
  • contracts/basket/contracts/singleJoinExit/SingleNativeTokenExit.sol:93
  • contracts/basket/contracts/singleJoinExit/SingleNativeTokenExitV2.sol:121

Tools Used

Editor

Recommended Mitigation Steps

Consider using address.call{value: v}("") and checking the return value or Openzeppelin Address library 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 Dec 19, 2021
code423n4 added a commit that referenced this issue Dec 19, 2021
@loki-sama loki-sama added the duplicate This issue or pull request already exists label Dec 29, 2021
@loki-sama
Copy link
Collaborator

Duplicate #231

@ghost ghost closed this as completed Jan 10, 2022
@0xleastwood
Copy link
Collaborator

Duplicate of #175

@0xleastwood 0xleastwood marked this as a duplicate of #175 Jan 23, 2022
@0xleastwood 0xleastwood added 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Jan 23, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants