Closed code423n4 closed 1 year ago
0xSorryNotSorry marked the issue as primary issue
deanamiel marked the issue as disagree with severity
Corrected Severity: QA The first case proposed could be possible, although the Axelar Gateway is not planning to add tokens any time soon, and it will migrate existing ones to the ITS in the future. All existing tokens have symbols that match the gateway symbols. Even if a gateway token is registered, there would not be any issues, except migrating tokens would become more difficult in the future.
Agree with sponsor. Downgrading to QA (Low).
berndartmueller changed the severity to QA (Quality Assurance)
berndartmueller marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2023-07-axelar/blob/main/contracts/cgp/AxelarGateway.sol#L385 https://github.com/code-423n4/2023-07-axelar/blob/main/contracts/its/interchain-token-service/InterchainTokenService.sol#L309
Vulnerability details
Impact
Allows any developer to register a token that is already registered with the gateway.
Vulnerability Details
In order to register a token as canonical, the
registerCanonicalToken
function is called and passed an address. The symbol of the passed token is checked to make sure it hasn't already been registered on the gateway before being deployed.The check can be bypassed in 2 different ways:
registerCanonicalToken
beforeAxelarGateway#deployToken
is called. Whether done by frontrunning or not. This can be done since the deployment is done with create2If the tokenSymbol registered to the gateway doesn't match the actual token at the address. This works for external tokens deployed on
AxelarGateway#deployToken
because the function doesn't check whether the passed symbol actually is the symbol of the token at the address.