Node crash from unrecovered panic in app mempool insert queue
Description
cosmos/evm ships a custom application mempool that runs the standard Cosmos SDK ante handler chain from a background insert-queue goroutine that performs no panic recovery. A maliciously crafted multisig transaction can cause an out-of-bounds slice read inside the ante handler's signature-gas consumption step, producing a Go panic. On the normal transaction-delivery path this panic would be recovered and the transaction rejected, but on the app-mempool path it terminates the entire node process.
An unauthenticated attacker controlling an ordinary (funded) multisig account can crash any evmd node running with mempool.type = "app" — the project's own recommended configuration — by submitting a single transaction, and can keep nodes offline by re-broadcasting. This is a denial of service only: there is no state corruption or chain fork.
Details
When evmd starts it force-enables the EVM app mempool (overriding mempool.max-txs in code) and requires config.toml's mempool.type = "app", so this is the default operating configuration for most nodes. Cosmos transactions entering this mempool are staged in mempool/internal/queue, whose background loop() goroutine drains batches and calls RecheckMempool.Insert → TxRechecker.RecheckCosmos → the standard ante handler chain. That goroutine has no recover(), and the ante handler's SetUpContextDecorator recovers only out-of-gas panics, re-panicking everything else.
The trigger is ante.ConsumeMultisignatureVerificationGas: when a transaction's MultiSignatureData bitarray claims more signers than there are signatures, the function indexes sig.Signatures[sigIndex] out of range. On the normal baseapp.RunTx delivery path this panic is recovered and the transaction simply fails; through the app mempool's background insert path nothing catches it, so the panic kills the entire process. The crash is deterministic per delivery and fires regardless of the ABCI transport (local, socket, or gRPC). The transaction does not self-propagate — it fails in the recheck step before reaching the reap list, and block execution recovers the same panic, so the impact is limited to nodes whose transaction ingress receives the crafted tx directly.
Patches
The fix wraps the queue's insert call in a recover(): a panic in the underlying mempool insert (including the ante handler it invokes) is logged with a stack trace and reported as an error for every transaction in the batch, so the offending transaction is rejected while the queue goroutine and the node keep running.
- Released in v0.7.4.
Chain operators must upgrade to v0.7.4 (or later).
Workarounds
There is no configuration-only mitigation. evmd's start command enables the EVM app mempool regardless of app.toml's mempool.max-txs setting, and it requires mempool.type = "app" in config.toml. Restricting RPC transaction ingress endpoints (e.g. disabling broadcast_tx RPC on public endpoints) limits the attack surface for externally exposed nodes but does not protect peer-to-peer ingress. Operators should upgrade.
References
- Releases: v0.7.4
Credits
Originally reported through the Cosmos bug bounty program by null.
Please reach out to our security email, security@cosmoslabs.io to get further details, or via our bug bounty program immunefi.com/