File: its/remote-address-validator/RemoteAddressValidator.sol
133: function getRemoteAddress(string calldata chainName) external view returns (string memory remoteAddress) {
134: remoteAddress = remoteAddresses[chainName];
135: if (bytes(remoteAddress).length == 0) {
136: remoteAddress = interchainTokenServiceAddress.toString(); // <-- defaults to current chain interchainTokenServiceAddress
137: }
138: }
Here a default value of the InterchainTokenService address for the source chain is sent if the chain is not configured. Thus if a user makes a mistake with the string for the chain. This message will be accepted and their tokens locked/burnt.
Almost all tests in tokenService.js and tokenServiceFullFlow.js are actually a PoC for this since none of them configure the destination chain in RemoteAddressValidator.
Tools Used
Manual audit
Recommended Mitigation Steps
Revert when the chainName provided is not configured.
Lines of code
https://github.com/code-423n4/2023-07-axelar/blob/main/contracts/its/remote-address-validator/RemoteAddressValidator.sol#L135-L137
Vulnerability details
Impact
If a user supplies an incorrect destination chain their funds will be locked/burnt in the token manager.
Proof of Concept
When doing a cross chain transfer using
InterchainTokenService
eventually all calls ends up in a cross chain instruction:https://github.com/code-423n4/2023-07-axelar/blob/main/contracts/its/interchain-token-service/InterchainTokenService.sol#L707-L724
Here the address for the corresponding
InterchainTokenService
contract is queried, then message is passed toAxelarGateway
.In
RemoteAddressValidator
this lookup is done:https://github.com/code-423n4/2023-07-axelar/blob/main/contracts/its/remote-address-validator/RemoteAddressValidator.sol#L133-L138
Here a default value of the
InterchainTokenService
address for the source chain is sent if the chain is not configured. Thus if a user makes a mistake with the string for the chain. This message will be accepted and their tokens locked/burnt.Almost all tests in
tokenService.js
andtokenServiceFullFlow.js
are actually a PoC for this since none of them configure the destination chain inRemoteAddressValidator
.Tools Used
Manual audit
Recommended Mitigation Steps
Revert when the
chainName
provided is not configured.Assessed type
Invalid Validation