Gas fees are refunded to a wrong address when transferring tokens via InterchainToken.interchainTransferFrom
When tokens are transferred cross-chain via InterchainToken.interchainTransferFrom, any gas fee refund is sent to the token owner rather than the caller who paid the fee. The caller loses the fee and does not receive tokens on the destination chain, while the owner keeps the tokens and receives the refund.
Submitted by Jeiwan, also found by Toshii, immeas, and pcarranzav
In a case when gas fees are refunded for a token transfer made via the InterchainToken.interchainTransferFrom function, the fees will be refunded to the owner of the tokens, not the address that actually paid the fees. As a result, the sender will lose the fees paid for the cross-chain transaction and will not receive tokens on the other chain; the owner of the token will have their tokens and will receive the fees.
Proof of Concept
The InterchainToken.interchainTransferFrom function is used to transfer tokens cross-chain. The function is identical to the ERC20.transferFrom function: an approved address can send someone else’s tokens to another chain. Since this is a cross-chain transaction, the sender also has to pay the additional gas fee for executing the transaction:
- The function calls tokenManager.transmitInterchainTransfer;
tokenManager.transmitInterchainTransfercalls interchainTokenService.transmitSendToken;interchainTokenService.transmitSendTokencalls _callContract;_callContractuses themsg.valueto pay the extra gas fees.
Notice that the gasService.payNativeGasForContractCall call in _callContract takes the refundTo address, i.e. the address that will receive refunded gas fee. If we return up on the call stack, we’ll see that the refund address is the sender address that’s passed to the tokenManager.transmitInterchainTransfer call. Thus, the gas fees will be refunded to the token owner, not the caller; however, it’s the caller who pays them.
Recommended Mitigation Steps
The TokenManager.transmitInterchainTransfer and the InterchainTokenService.transmitSendToken functions, besides taking the sender/sourceAddress argument, need to also take the “refund to” address. In the InterchainToken.interchainTransferFrom function, the two arguments will be set to different addresses: the sender/sourceAddress argument will be set to the token owner address; the new “refund to” argument will be set to msg.sender. Thus, while tokens will be taken from their owner, the cross-chain gas fees will be refunded to the actual transaction sender.
Assessed type
ETH-Transfer
deanamiel (Axelar) disagreed with severity and commented:
Corrected Severity: QA
In most cases, it will have been called by the sender anyway, so having the sender be refunded is the desired effect. Sometimes this will not be the case though, depending on the use case. Therefore, we have added a parameter to keep track of where the funds need to be refunded.
Link to public PR: https://github.com/axelarnetwork/interchain-token-service/pull/96
berndartmueller (judge) decreased severity to Medium and commented:
Considering this medium severity as per:
“…In most cases it will have been called by the sender anyway” (sponsors statement above).
Nevertheless, in the cases where an approved address transfers the tokens, the gas is incorrectly refunded.
milapsheth (Axelar) commented:
We acknowledge the severity.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The refund address is set to the token sender (owner) rather than the caller who pays the gas fee, because the same address is used for both roles.
Impact
The caller who paid the gas fee loses that fee and does not receive tokens on the destination chain, while the token owner keeps the tokens and receives the refund; the sponsor noted this only affects cases where an approved address, not the owner, initiates the transfer.
What the attacker needed
An approved spender initiates the transfer; gas fees are refunded
The fix
The transfer functions should accept a separate refund address, set to msg.sender in interchainTransferFrom, so fees are refunded to the actual payer; the project added such a parameter in a public pull request.
How it was found
- An approved address calls interchainTransferFrom to move someone else's tokens to another chain.
- The call chain passes the token owner as the sender and uses msg.value to pay gas fees.
- The gas service records the token owner as the refund recipient.
- Any gas fee refund goes to the token owner, not the caller who paid.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This is a smart contract bug in a cross-chain token transfer system. When someone else (an approved spender) sends tokens on behalf of the owner, they also pay a gas fee for the cross-chain message. The code mistakenly refunds any leftover gas fee to the token owner instead of the person who paid it, so the payer loses money.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.