Submitted by berndartmueller
ZetaChain blocks can be griefed by a single observer, possibly preventing other transactions from being processed.
A Cosmos SDK apps ante handler verifies transactions (gas, messages,..) before further processing and before the individual messages are passed onto the respective handlers.
ZetaChain sets up the ante handler in the NewAnteHandler function and handles transactions differently depending on their type. For example,
MsgEthereumTx Evmos EVM messages require different ante handlers than regular Cosmos SDK messages.
Specifically, regular Cosmos SDK transactions have their messages checked in lines 97-112 and if at least one of the messages is a MsgGasPriceVoter or MsgVoteOnObservedInboundTx message, an infinite transaction gas meter is used.
The reasoning is that both the MsgGasPriceVoter and MsgVoteOnObservedInboundTx messages (exclusively limited to observers) interact with the internal zEVM (Evmos), which has a different gas model (EVM equivalent) than Cosmos SDK. To prevent out-of-gas errors, an infinite gas meter is used.
However, this is problematic as the code in line 97-112 only checks if at least one of the messages is a MsgGasPriceVoter or MsgVoteOnObservedInboundTx message. If the transaction also contains other messages, the same infinite transaction gas meter applies to them as well and the transaction will not run out of gas.
Consequently, a turned-malicious observer can craft a transaction that contains a MsgGasPriceVoter or MsgVoteOnObservedInboundTx message and a lot of other messages that consume a lot of gas. As the infinite transaction gas meter is used, the transaction will be processed without running out of gas. The observer only pays a negligible amount of gas (purposefully set very low) but is able to spam the network and fill up block space, possibly preventing other transactions from being processed if the block gas limit is reached (which is set by default to 10 million in CometBFT).
Nevertheless, this is a privilege escalation as single observes are not supposed to have such a significant impact on the ZetaChains block space, and thus, medium severity was chosen.
Consider only using the infinite transaction gas meter if all of the transactions messages are of the type MsgGasPriceVoter or MsgVoteOnObservedInboundTx.
DadeKuma (Lookout) commented:
lumtis (ZetaChain) confirmed
