CVE-2024-32644

CVE-2024-32644 is a critical-severity security vulnerability in github.com/evmos/evmos/v16 (go), affecting versions <= 16.0.4. It is fixed in 17.0.0.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Evmos transaction execution not accounting for all state transition after interaction with precompiles

Context

  • stateObject: represents the state of an account and is used to store its updates during a state transition. This is accomplished using two in memory Storage variables: originStorage and dirtyStorage
  • StateDB: it is the general interface to retrieve accounts and holds a map of stateObjects.

Severity

Based on ImmuneFi Severity Classification System the severity was evaluated to Critical since the attack could have lead to direct loss of funds.

For more information

If you have any questions or comments about this advisory:

Reach out to the Core Team in Discord
Open a discussion in evmos/evmos
Email us at [email protected] for security questions

Impact

An external contributor, @iczc, discovered 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.

Below, are described the steps to perform the attack:

  • User send a tx to a smart contract (SC) that is calling a precompile.
  • The SC perform a state transition of its state from A to B.
  • The SC call the precompile.
  • The SC perform a state transition of its state from B to A (revert of the previous).
  • Once the transaction is executed, and the final Commit is performed, the state A will not be committed to the store because A is the same as originStorage.

If the tx is executed correctly, this is what happens at the store level:

  • Initial state A is loaded from the KVStore and the dirtyStorage is set to B.
  • Before running the precompile, the dirtyStorage is committed to the KVStore without changing the originStorage.
  • Now, since we have a dirtyStorage, it is updated to the previous value A without changing the originStorage.

Since the tx executed correctly, the evm calls the commit to persist the dirtyStorage. However, since dirtyStorage is equal to originStorage, nothing will be changed.

To summarize, 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.

CVE-2024-32644 has a CVSS score of 9.1 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (17.0.0); upgrading removes the vulnerable code path.

Affected versions

github.com/evmos/evmos/v16 (<= 16.0.4) github.com/evmos/evmos/v7 (<= 7.0.0) github.com/evmos/evmos/v6 (<= 6.0.4) github.com/evmos/evmos/v5 (<= 5.0.0) github.com/tharsis/evmos (<= 1.1.3) github.com/tharsis/evmos/v2 (<= 2.0.2) github.com/tharsis/evmos/v3 (<= 3.0.3) github.com/tharsis/evmos/v4 (<= 4.0.2) github.com/tharsis/evmos/v5 (<= 5.0.1)

Security releases

github.com/evmos/evmos/v16 → 17.0.0 (go)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

The issue has been patched in versions >=V17.0.0.

Frequently Asked Questions

  1. What is CVE-2024-32644? CVE-2024-32644 is a critical-severity security vulnerability in github.com/evmos/evmos/v16 (go), affecting versions <= 16.0.4. It is fixed in 17.0.0.
  2. How severe is CVE-2024-32644? CVE-2024-32644 has a CVSS score of 9.1 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which packages are affected by CVE-2024-32644?
    • github.com/evmos/evmos/v16 (go) (versions <= 16.0.4)
    • github.com/evmos/evmos/v7 (go) (versions <= 7.0.0)
    • github.com/evmos/evmos/v6 (go) (versions <= 6.0.4)
    • github.com/evmos/evmos/v5 (go) (versions <= 5.0.0)
    • github.com/tharsis/evmos (go) (versions <= 1.1.3)
    • github.com/tharsis/evmos/v2 (go) (versions <= 2.0.2)
    • github.com/tharsis/evmos/v3 (go) (versions <= 3.0.3)
    • github.com/tharsis/evmos/v4 (go) (versions <= 4.0.2)
    • github.com/tharsis/evmos/v5 (go) (versions <= 5.0.1)
  4. Is there a fix for CVE-2024-32644? Yes. CVE-2024-32644 is fixed in 17.0.0. Upgrade to this version or later.
  5. Is CVE-2024-32644 exploitable, and should I be worried? Whether CVE-2024-32644 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2024-32644 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2024-32644? Upgrade github.com/evmos/evmos/v16 to 17.0.0 or later.

Other vulnerabilities in github.com/evmos/evmos/v16

Stop the waste.
Protect your environment with Kodem.