Submitted by Udsen, also found by adriro, pep7siup, kutugu, ast3ros, bin2chen, 0xDING99YA, SpicyMeatball, 0xpiken (1, 2), bowtiedvirus, Inspecktor, and seerether
The DestinationBridge._execute is an internal function that is executed when contract is called by Axelar Gateway. The _execute function stores the Transaction struct in the txnHashToTransaction mapping as shown below:
The transaction hash txnHash is calculated by keccak256(payload) and the payload is an abi encoded value consisting of following variables.
The issue here is that the two different srcChains with two different srcAddr contracts can end up providing the same txnHash if the above mentioned version, srcSender, amt and nonce are the same. The _execute function only restricts the same srcAddr to not to use the same nonce as shown below:
But the problem is if there are different srcAddrs providing the same payload it will result into the same txnHash.
Hence, there could be two transactions with the same transaction hash (txnHash). The later transaction will override the txnToThresholdSet[txnHash] of the former transaction. As a result, the approval process for transaction minting will be broken.
https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L108-L109
https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L137-L140
https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L90-L91
VSCode
It is recommended to include the srcChain and the srcAddr in the payload as well, which is getting hashed to calculate the txnHash. By doing so, different transactions coming from different srcChains and srcAddr will not result into the same txnHash. The approval process for the transaction minting via the bridge will successfully execute.
kirk-baird (judge) decreased severity to Medium
ali2251 (Ondo) confirmed
