Lucene search

K
code423n4Code4renaCODE423N4:2022-03-LIFINANCE-FINDINGS-ISSUES-203
HistoryMar 30, 2022 - 12:00 a.m.

Using the native payable.transfer to send ETH in WithdrawFacet

2022-03-3000:00:00
Code4rena
github.com
4

Lines of code

Vulnerability details

Impact

The withdraw function in WithdrawFacet uses the native transfer keyword to send ETH, which is considered unsafe because of the fixed gas budget, and its functionality could be broken in some circumstances:

  1. The receiver consumes more than 2300 amounts of gas when receiving the ETH.
  2. Even if the receiver consumes less than 2300 amount of gas, the consumed gas amount could change in the future when hard forks happen and therefore could exceed the limit.

Proof of Concept

WithdrawFacet.sol#L31

Recommended Mitigation Steps

Consider using a low-level call to send ETH, for example, the LibAsset.transferNativeAsset function.


The text was updated successfully, but these errors were encountered:

All reactions