Skip to main content
Menu
Advisories

Balance underflow in EVM StateDB

GHSA-7G4W-CG88-2CQ2Published Updated GitHub

Description

_This security advisory describes the vulnerability outlined in the August 28, 2026 Cosmos EVM post-mortem._

Summary

Cosmos EVM tracks account balances in an EVM StateDB that is reconciled with the Cosmos SDK x/bank module. The StateDB only models an account's spendable balance, but vesting accounts in SDK state hold both a spendable and a locked balance, and both x/staking and the staking precompile permit delegating the locked portion.

When a vesting account delegates more than its spendable balance, the post-delegation write-back subtracts the full delegated amount from the StateDB's spendable view, producing an unchecked underflow that wraps the account balance to ≈2²⁵⁶.

Details

The EVM StateDB sees only an account's spendable balance. When a vesting account delegates an amount greater than its spendable balance (i.e., dips into its locked balance, which x/staking and the staking precompile permit), the SubBalance write-back on the StateDB subtracts the full delegated amount from a smaller spendable figure. The subtraction is unchecked and wraps the balance to ≈2²⁵⁶.

Patches

The fix adds an underflow guard to the StateDB SubBalance write-back.

  • Fixed on main in #1176.
  • Backported to release/v0.6.x in #1253 (commit 82b3ef6c8) and released in v0.6.2.
  • Backported to release/v0.7.x in #1254 (commit 0182da198) and released in v0.7.2.

Chain operators must upgrade to v0.6.2 or v0.7.2 (or later). The change is state-breaking and requires a coordinated network upgrade.

Workarounds

There is no configuration-only mitigation. If an operator cannot upgrade immediately, halt the chain rather than attempt a coordinated governance upgrade. Disabling the staking precompile removes the primary trigger path but is not a substitute for the patch.

References

Credits

Originally reported through the Cosmos bug bounty program by @AshmitSh4rma (github.com/ashmitsh4rma) and by additional independent security researchers who provided reproduction details enabling a full assessment.

Please reach out to our security email, security@cosmoslabs.io to get further details, or via our bug bounty program immunefi.com/bug-bounty/cosmos to report known vulnerabilities.

Affected versions

References

GitHub · cosmos/evm