Evmos' transaction execution not accounting for all state transition after interaction with precompiles
evmos
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/evmos/evmos/v16 Go |
|
|
| github.com/evmos/evmos/v7 Go |
| No fix yet |
evmos
| Product | Affected | Fixed in |
|---|---|---|
| github.com/evmos/evmos/v16 Go |
|
|
| github.com/evmos/evmos/v7 Go |
| No fix yet |
|
| No fix yet |
| github.com/evmos/evmos/v5 Go |
| No fix yet |
| github.com/tharsis/evmos Go |
| No fix yet |
| github.com/tharsis/evmos/v2 Go |
| No fix yet |
| github.com/tharsis/evmos/v3 Go |
| No fix yet |
| github.com/tharsis/evmos/v4 Go |
| No fix yet |
| github.com/tharsis/evmos/v5 Go |
| No fix yet |
| github.com/evmos/evmos Go |
| No fix yet |
| github.com/evmos/evmos/v2 Go |
| No fix yet |
| github.com/evmos/evmos/v3 Go |
| No fix yet |
| github.com/evmos/evmos/v4 Go |
| No fix yet |
| github.com/evmos/evmos/v8 Go |
| No fix yet |
| github.com/evmos/evmos/v9 Go |
| No fix yet |
| github.com/evmos/evmos/v10 Go |
| No fix yet |
| github.com/evmos/evmos/v11 Go |
| No fix yet |
| github.com/evmos/evmos/v12 Go |
| No fix yet |
| github.com/evmos/evmos/v13 Go |
| No fix yet |
| github.com/evmos/evmos/v14 Go |
| No fix yet |
| github.com/evmos/evmos/v15 Go |
| No fix yet |
| github.com/evmos/evmos/v17 Go |
|
|
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.
From the CVE record · GitHub_M
Before 17.0.0, evmos can leave its Cosmos SDK and EVM states out of sync during a transaction. An attacker can exploit smart-contract interactions that change storage during a transaction and then restore it before the transaction ends to mint arbitrary tokens, potentially draining funds. The input does not specify authentication requirements or whether user interaction is needed.
Engineers running evmos or using the listed affected Go packages should check their versions; github.com/evmos/evmos/v16 versions before 17.0.0 are affected, and the listed older package lines have no fixed version.