Closed code423n4 closed 2 years ago
Funds gets deposited to the specific deposit addresses that are generated from the original AxelarDepositService
. The address of AxelarDepositService
is used for the deposit address computation. If some other contract will implement AxelarDepositService
and will try to deploy a DepositReceiver
. It will get deployed to a completely different address and wont be able to access the funds
I have to agree with the Sponsor, the DepositReceiver
is deposited via create2
while we can predict the address of multiple DepositReceiver
s by mining the salt
, we would have to break secp256k1
to be able to create a new contract that can deploy at that same address
Closing as invalid because of that reason, in lack of POC
Lines of code
https://github.com/code-423n4/2022-07-axelar/blob/9c4c44b94cddbd48b9baae30051a4e13cbe39539/contracts/deposit-service/ReceiverImplementation.sol#L16-L40
Vulnerability details
Impact
Malicious DepositBase may stole dust fund from ReceiverImplementation
Proof of Concept
Attacker just craft a malicious DepositBase with refundToken has a value of token address that he want to steal. And call ReceiverImplementation.receiveAndSendToken from that contract to get both dust native token from
if (address(this).balance > 0) refundAddress.transfer(address(this).balance);
and ERC20 token from_safeTransfer(refund, refundAddress, IERC20(refund).balanceOf(address(this)));
Tools Used
Manual review
Recommended Mitigation Steps
Whitelist the valid AxelarDepositService