github.com/evmos/evmos/v16
Affected
- introduced
0, fixed17.0.0(semver)
Fixed versions
17.0.0
Fix
- Fixed version
17.0.0go get github.com/evmos/evmos/[email protected]
Advisory
Also known as: CVE-2024-32644, GO-2024-2715
Evmos transaction execution not accounting for all state transition after interaction with precompiles
Context
originStorage and dirtyStorageImpact
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:
originStorage. If the tx is executed correctly, this is what happens at the store level:
dirtyStorage is committed to the KVStore without changing the originStorage.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.
Severity
Based on ImmuneFi Severity Classification System the severity was evaluated to Critical since the attack could have lead to direct loss of funds.
Patches
The issue has been patched in versions >=V17.0.0.
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]](mailto:[email protected]) for security questions
Critical Basis: The source's own band: CRITICAL
0, fixed 17.0.0 (semver)17.0.0
17.0.0go get github.com/evmos/evmos/[email protected]0, last affected 7.0.0 (semver)None listed
No fixed version is listed.
0, last affected 6.0.4 (semver)None listed
No fixed version is listed.
0, last affected 5.0.0 (semver)None listed
No fixed version is listed.
0, last affected 1.1.3 (semver)None listed
No fixed version is listed.
0, last affected 2.0.2 (semver)None listed
No fixed version is listed.
0, last affected 3.0.3 (semver)None listed
No fixed version is listed.
0, last affected 4.0.2 (semver)None listed
No fixed version is listed.
0, last affected 5.0.1 (semver)None listed
No fixed version is listed.
Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0