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

Usage of deprecated transfer to send ETH #52

Closed
code423n4 opened this issue Jul 27, 2022 · 1 comment
Closed

Usage of deprecated transfer to send ETH #52

code423n4 opened this issue Jul 27, 2022 · 1 comment
Labels
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 duplicate This issue or pull request already exists

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-07-golom/blob/main/contracts/core/GolomTrader.sol#L151-L156

Vulnerability details

Impact

The use of the deprecated transfer() function will inevitably make the transaction fail when:

  • The receiver smart contract does not implement a payable function.
  • The receiver smart contract does implement a payable fallback which uses more than 2300 gas unit.
  • The receiver smart contract implements a payable fallback function that needs less than 2300 gas units but is called through proxy, raising the call's gas usage above 2300.

More over, using higher than 2300 gas might be mandatory for some multisig wallets.

Proof of Concept

Recommended Mitigation Steps

Using call() instead of transfer()

@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 Jul 27, 2022
code423n4 added a commit that referenced this issue Jul 27, 2022
@KenzoAgada
Copy link

Duplicate of #343

@liveactionllama liveactionllama added the duplicate This issue or pull request already exists label Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants