code-423n4 / 2022-07-axelar-findings

0 stars 0 forks source link

`call()` should be used instead of `transfer()` on an address payable #180

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

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 on ReceiverImplementation.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

Recommended Mitigation Steps

Recommend using call() instead of transfer(), and make sure to check for reentrancy.

GalloDaSballo commented 2 years ago

See #203

re1ro commented 2 years ago

Duplicate of #4