call()
should be used instead of transfer()
on an address payable
#203
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
Lines of code
https://github.com/code-423n4/2022-07-axelar/blob/94498f8ae1fb1df655dfb89f7f525f94d92f5de0/contracts/deposit-service/ReceiverImplementation.sol#L23
https://github.com/code-423n4/2022-07-axelar/blob/94498f8ae1fb1df655dfb89f7f525f94d92f5de0/contracts/deposit-service/ReceiverImplementation.sol#L51
https://github.com/code-423n4/2022-07-axelar/blob/94498f8ae1fb1df655dfb89f7f525f94d92f5de0/contracts/deposit-service/ReceiverImplementation.sol#L71
https://github.com/code-423n4/2022-07-axelar/blob/94498f8ae1fb1df655dfb89f7f525f94d92f5de0/contracts/deposit-service/ReceiverImplementation.sol#L86
https://github.com/code-423n4/2022-07-axelar/blob/94498f8ae1fb1df655dfb89f7f525f94d92f5de0/contracts/gas-service/AxelarGasService.sol#L128
https://github.com/code-423n4/2022-07-axelar/blob/94498f8ae1fb1df655dfb89f7f525f94d92f5de0/contracts/gas-service/AxelarGasService.sol#L144
https://github.com/code-423n4/2022-07-axelar/blob/94498f8ae1fb1df655dfb89f7f525f94d92f5de0/contracts/xc20/contracts/XC20Wrapper.sol#L63
Vulnerability details
This is a classic Code4rena issue:
Impact
The use of the deprecated
transfer()
function for an address will inevitably make the transaction fail when:Additionally, using higher than 2300 gas might be mandatory for some multisig wallets.
Impacted lines:
Recommended Mitigation
Use
call()
instead oftransfer()
, but be sure to respect the CEI pattern and/or add re-entrancy guards, as several hacks already happened in the past due to this recommendation not being fully understood.Relevant links:
https://twitter.com/hacxyk/status/1520715516490379264?s=21&t=fnhDkcC3KpE_kJE8eLiE2A
https://twitter.com/hacxyk/status/1520715536325218304?s=21&t=fnhDkcC3KpE_kJE8eLiE2A
https://twitter.com/hacxyk/status/1520370441705037824?s=21&t=fnhDkcC3KpE_kJE8eLiE2A
https://twitter.com/Hacxyk/status/1521949933380595712
The text was updated successfully, but these errors were encountered: