The RemoteAddressValidator contract is used to map the destination chain to corresponding interchainTokenService contract address of that chain. There is a function called removeTrustedAddress where the owner of the contract can remove the trusted interchain token service address from the respective chain.
But this function is not controlled by a timelock. Hence if this function is executed and the existing interchainTokenService address is removed, for the live transactions coming to this service contract will be routed to the interchainTokenService contract of the ethereum chain due to the following configuration in the RemoteAddressValidator.getRemoteAddress function.
if (bytes(remoteAddress).length == 0) {
remoteAddress = interchainTokenServiceAddress.toString();
}
As a result if the destinaction chain is not ethereum and the owner of the RemoteAddressValidator decides to remove the service contract by calling removeTrustedAddress, the pending transactions will now be routed to the interchainTokenServiceAddress of the ethereum chain thus breaking the protocol.
Hence it is recommended to add a timelock to the removeTrustedAddress function so the users will know the service contract has been removed. So they can stop sending token transfer transactions to that destination chain till a new service contract is configured.
Lines of code
https://github.com/code-423n4/2023-07-axelar/blob/main/contracts/its/remote-address-validator/RemoteAddressValidator.sol#L95-L100 https://github.com/code-423n4/2023-07-axelar/blob/main/contracts/its/remote-address-validator/RemoteAddressValidator.sol#L133-L138
Vulnerability details
Impact
The
RemoteAddressValidator
contract is used to map the destination chain to correspondinginterchainTokenService
contract address of that chain. There is a function calledremoveTrustedAddress
where the owner of the contract can remove the trustedinterchain token service address
from the respective chain.But this function is not controlled by a
timelock
. Hence if this function is executed and the existinginterchainTokenService
address is removed, for the live transactions coming to thisservice
contract will be routed to theinterchainTokenService
contract of theethereum
chain due to the following configuration in theRemoteAddressValidator.getRemoteAddress
function.As a result if the destinaction chain is not
ethereum
and the owner of theRemoteAddressValidator
decides to remove theservice
contract by callingremoveTrustedAddress
, the pending transactions will now be routed to theinterchainTokenServiceAddress
of theethereum chain
thus breaking the protocol.Proof of Concept
https://github.com/code-423n4/2023-07-axelar/blob/main/contracts/its/remote-address-validator/RemoteAddressValidator.sol#L95-L100
https://github.com/code-423n4/2023-07-axelar/blob/main/contracts/its/remote-address-validator/RemoteAddressValidator.sol#L133-L138
Tools Used
Manual Review and VSCode
Recommended Mitigation Steps
Hence it is recommended to add a timelock to the
removeTrustedAddress
function so the users will know theservice contract
has been removed. So they can stop sending token transfer transactions to that destination chain till a newservice
contract is configured.Assessed type
Other