Submitted by ChristiansWhoHack, also found by berndartmueller
Ethermint runs hooks after the execution of a transaction. Currently, within the Zetachain setup, there are two modules using hooks: crosschain and fungible. The crosschain hook processes outgoing calls to withdraw for ZRC20 tokens and zeta sends. The fungible module checks to see if the ZRC20 token is paused or not.
When calling into the zEVM from the crosschain module on a cctx, the call is below the place where the hooks run; this means that the Ethermint hooks are not triggered. There is a call to processLogs from the crosschain module but there is no call to CheckZRC20Paused() function. If a token was paused, an attacker could circumvent the pausing protection by setting up a smart contract to execute on the onCrossChainCall() callback to trigger a withdrawal that should not be possible. The pausing may be used in events once a vulnerability is discovered. So, bypassing this assumed protection could have catastrophic consequences.
The proof of concept is a Cosmos SDK test that accesses the Withdrawal functionality within a CCTX.
Add in the following code for user facing zEVM calls. For instance, evm_deposit.go should check whether or not the token was paused.
The pausing check is currently happening after a zEVM call via hooks and not in the contract itself. Having use before a check is considered bad practice, since extra computation occurs. In this case, it appears that the added complexity having this check not in the smart contract led to the vulnerability.
Adding the pausing functionality to the smart contract makes it less complex and more visible to everyone involved. It is recommended to do this.
lumtis (ZetaChain) confirmed
0xean (Judge) decreased severity to Medium and commented:
