# A regular Cosmos SDK message can be disguised as an EVM transaction, causing ListenFinalizeBlock to error which prevents the block from being indexed

A Cosmos SDK message signed with SignMode_SIGN_MODE_ETHEREUM is misclassified as an EVM tx, making ListenFinalizeBlock error and halting block indexing.

- Payout: Contest reward
- Severity: high
- Program: Initia
- Credited: berndartmueller
- Disclosed: 2025-04-10
- Write-up quality: 8/10
- Original: https://code4rena.com/reports/2025-02-initia-cosmos#h-02
- Library page: https://bugbountylibrary.com/r/c4%3A2025-02-initia-cosmos%3AH-02
- Tags: domain:web3 impact:dos impact:integrity kind:contest platform:code4rena sev:high tech:evm technique:chained technique:source-review vuln:dos vuln:misconfiguration

**Target:** EVM indexer ListenFinalizeBlock / ConvertCosmosTxToEthereumTx
**Root cause:** ConvertCosmosTxToEthereumTx treats any tx signed with SIGN_MODE_ETHEREUM as an EVM tx without validating the message type URL; the indexer's unpackData then expects MsgCreateResponse/MsgCallResponse and errors on mismatch.
**Steps:**
1. Build a Cosmos tx containing a non-EVM message (e.g. bank MsgMultiSend) signed with SignMode_SIGN_MODE_ETHEREUM.
2. Submit it; ante handler accepts since signature is valid.
3. ConvertCosmosTxToEthereumTx bypasses the type-URL switch (txData.To=nil, Data=nil) and treats it as EVM tx.
4. Tx executes successfully; ListenFinalizeBlock calls extractLogsAndContractAddr -> unpackData, which errors on unexpected type URL.
5. ListenFinalizeBlock returns error, aborting the loop; block and all its txs are not indexed, pruning and bloom filter skipped.
**How found:** Code reading of ConvertCosmosTxToEthereumTx and the indexer's unpackData; noticed the type-URL switch has no default and that SIGN_MODE_ETHEREUM signing lets arbitrary Cosmos messages be classified as EVM txs.
**Exploitation:** Attacker submits a validly-signed Cosmos message (e.g. MsgMultiSend) using Ethereum sign mode; it passes ante, executes, but breaks the indexer for the entire block, hiding all txs (including victim txs) from JSON-RPC queries.
**Escalation:** A single malicious tx per block suppresses indexing of every transaction in that block, enabling denial of indexing / hiding of activity.
**Insight:** When a chain supports Ethereum sign mode for Cosmos messages, audit every place that infers message type from sign mode rather than the actual type URL; indexer/streaming hooks that assume a fixed response type are prime DoS targets.
