call()
should be used instead of transfer()
on an address payable
#180
Labels
bug
Something isn't working
edited-by-warden
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Lines of code
https://github.com/code-423n4/2022-07-axelar/blob/main/contracts/deposit-service/ReceiverImplementation.sol#L23
https://github.com/code-423n4/2022-07-axelar/blob/main/contracts/deposit-service/ReceiverImplementation.sol#L51
https://github.com/code-423n4/2022-07-axelar/blob/main/contracts/deposit-service/ReceiverImplementation.sol#L71
https://github.com/code-423n4/2022-07-axelar/blob/main/contracts/deposit-service/ReceiverImplementation.sol#L86
Vulnerability details
Using
transfer()
for ETH refund onReceiverImplementation.sol
Impact
The use of the deprecated
transfer()
function will inevitably make the transaction fail when:More over, using higher than 2300 gas might be mandatory for some multisig wallets.
Proof of Concept
transfer()
andsend()
use a hardcoded gas amount.receiveAndSendToken()
,receiveAndSendNative()
,receiveAndUnwrapNative()
functions are using transfer (with fixed stipend 2300 gas)refundAddress
) are smart contract, there is possibility of failure, and then revert the transaction.Recommended Mitigation Steps
Recommend using
call()
instead oftransfer()
, and make sure to check for reentrancy.The text was updated successfully, but these errors were encountered: