{"id":"CVE-2024-32644","published":"2024-04-19T14:53:44Z","modified":"2024-08-02T02:13:40Z","title":"Evmos' transaction execution not accounting for all state transition after interaction with precompiles","vendor":"evmos","product":"evmos","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.1,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00943,"percentile":0.61895,"provenance":"source"},"cwes":[{"id":"CWE-662","name":"Improper Synchronization"}],"references":[{"url":"https://github.com/evmos/evmos/security/advisories/GHSA-3fp5-2xwh-fxm6","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/evmos/evmos/commit/08982b5ee726b97bc50eaf58d1914829648b6a5f","tags":["x_refsource_MISC"]},{"url":"https://github.com/evmos/evmos/blob/b196a522ba4951890b40992e9f97aa610f8b5f9c/x/evm/statedb/statedb.go#L460-L465","tags":["x_refsource_MISC"]}],"priority":{"score":18.7,"factors":[{"name":"EPSS percentile","points":12.38},{"name":"CVSS severity","points":6.37}]},"vendorSlug":"evmos","affectedVersions":[{"vendor":"evmos","product":"evmos","versions":["< 17.0.0"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2024-05-14T17:14:05.889815Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Go","package":"github.com/evmos/evmos/v16","vulnerableRanges":["<17.0.0","all versions"],"patched":["17.0.0"],"from":["GHSA-3fp5-2xwh-fxm6","GO-2024-2715"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/evmos/evmos/v7","vulnerableRanges":["<=7.0.0","all versions"],"patched":[],"from":["GHSA-3fp5-2xwh-fxm6","GO-2024-2715"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/evmos/evmos/v6","vulnerableRanges":["<=6.0.4","all versions"],"patched":[],"from":["GHSA-3fp5-2xwh-fxm6","GO-2024-2715"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/evmos/evmos/v5","vulnerableRanges":["<=5.0.0","all versions"],"patched":[],"from":["GHSA-3fp5-2xwh-fxm6","GO-2024-2715"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/tharsis/evmos","vulnerableRanges":["<=1.1.3","all versions"],"patched":[],"from":["GHSA-3fp5-2xwh-fxm6","GO-2024-2715"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/tharsis/evmos/v2","vulnerableRanges":["<=2.0.2","all versions"],"patched":[],"from":["GHSA-3fp5-2xwh-fxm6","GO-2024-2715"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/tharsis/evmos/v3","vulnerableRanges":["<=3.0.3","all versions"],"patched":[],"from":["GHSA-3fp5-2xwh-fxm6","GO-2024-2715"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/tharsis/evmos/v4","vulnerableRanges":["<=4.0.2","all versions"],"patched":[],"from":["GHSA-3fp5-2xwh-fxm6","GO-2024-2715"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/tharsis/evmos/v5","vulnerableRanges":["<=5.0.1","all versions"],"patched":[],"from":["GHSA-3fp5-2xwh-fxm6","GO-2024-2715"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/evmos/evmos","vulnerableRanges":["all versions"],"patched":[],"from":["GO-2024-2715"],"provenance":"source"}],"euvd":{"id":"EUVD-2024-1080","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-evmos-cve-2024-32644","children":[{"from":"CVE-2024-32644","to":"CVE-2024-37153","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["precompiles/ics20/ics20.go"],"commits":["https://github.com/evmos/evmos/commit/08982b5ee726b97bc50eaf58d1914829648b6a5f","https://github.com/evmos/evmos/commit/478b7a62e7af57a70cf3a01126c7f5a89bee69d7"],"basis":"rarely changed file"}]}]}}