Closed code423n4 closed 1 year ago
The final salt includes msg.sender in Create3 contract as below;
function deploy(bytes calldata bytecode, bytes32 salt) external returns (address deployedAddress_) {
bytes32 deploySalt = keccak256(abi.encode(msg.sender, salt));
deployedAddress_ = Create3.deploy(deploySalt, bytecode);
emit Deployed(keccak256(bytecode), salt, deployedAddress_);
}
Invalid assumption.
0xSorryNotSorry marked the issue as low quality report
berndartmueller marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-07-axelar/blob/2f9b234bb8222d5fbe934beafede56bfb4522641/contracts/its/interchain-token-service/InterchainTokenService.sol#L170-L173 https://github.com/code-423n4/2023-07-axelar/blob/2f9b234bb8222d5fbe934beafede56bfb4522641/contracts/its/utils/TokenManagerDeployer.sol#L33-L43
Vulnerability details
Impact
The attacker can block canonical Tokens creation.
Proof of Concept
To be able to deploy canonical tokens, we need to call registerCanonicalToken() and deployRemoteCanonicalToken() functions. These functions will deploy token managers and then deploy the token.
registerCanonicalToken() function uses interchainTokenService address and tokenAdress as params. And these params will affect the creation of the token manager, as we see below. (bytecode and address)
The problem is , anyone can call deployTokenManager() directly with different
bytes calldata params
and deploy different token manager.(address and bytecode)This should cause trouble because,
First, any other token manager cant be deployed because they are using the same salt for tokenId. Second, canonical token deployment is blocked because when the user wants to continue the process and call the deployRemoteCanonicalToken() function,
deployRemoteCanonicalToken() function will call getValidTokenManagerAddress() for tokenId , and that call will revert because the attacker changed deployment parameters.
Tools Used
Manual review
Recommended Mitigation Steps
Not being able to call the deployTokenManager() function freely will solve the issue.
Assessed type
Other