Vulnerability · Published Aug 5, 2022 · Assigned by GitHub_M
CVE-2022-35936Ethermint DoS through Unintended Contract Selfdestruct
High 8.2
In plain English
A high-severity security flaw in ethermint from evmos. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 1.5% (higher than 74% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
Ethermint is an Ethereum library. In Ethermint running versions before `v0.17.2`, the contract `selfdestruct` invocation permanently removes the corresponding bytecode from the internal database storage. However, due to a bug in the `DeleteAccount`function, all contracts that used the identical bytecode (i.e shared the same `CodeHash`) will also stop working once one contract invokes `selfdestruct`, even though the other contracts did not invoke the `selfdestruct` OPCODE. This vulnerability has been patched in Ethermint version v0.18.0. The patch has state machine-breaking changes for applications using Ethermint, so a coordinated upgrade procedure is required. A workaround is available. If a contract is subject to DoS due to this issue, the user can redeploy the same contract, i.e. with identical bytecode, so that the original contract's code is recovered. The new contract deployment restores the `bytecode hash -> bytecode` entry in the internal state.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Go | github.com/Kava-Labs/kava | 0.18.0 | GHSA-f92v-grc2-w2fg |
| Go | github.com/crypto-org-chain/cronos | 0.7.1-rc2 | GHSA-f92v-grc2-w2fg |
| Go | github.com/crypto-org-chain/cronos | 0.7.1-rc2 | GO-2022-0760 |
| Go | github.com/evmos/ethermint | 0.18.0 | GHSA-f92v-grc2-w2fg |
| Go | github.com/evmos/ethermint | 0.18.0 | GO-2022-0760 |
| Go | github.com/evmos/evmos | 7.0.0 | GHSA-f92v-grc2-w2fg |
| Go | github.com/evmos/evmos | no fix listed | GO-2022-0760 |
| Go | github.com/evmos/evmos/v2 | no fix listed | GO-2022-0760 |
| Go | github.com/evmos/evmos/v3 | no fix listed | GO-2022-0760 |
| Go | github.com/evmos/evmos/v4 | no fix listed | GO-2022-0760 |
| Go | github.com/evmos/evmos/v5 | no fix listed | GO-2022-0760 |
| Go | github.com/evmos/evmos/v6 | no fix listed | GO-2022-0760 |
| Go | github.com/evmos/evmos/v7 | 7.0.0 | GO-2022-0760 |
| Go | github.com/kava-labs/kava | 0.18.0 | GO-2022-0760 |
Affected products (as reported)
Weakness: CWE-668 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
References
- https://github.com/evmos/ethermint/security/advisories/GHSA-f92v-grc2-w2fg x_refsource_CONFIRM
- https://github.com/evmos/ethermint/commit/144741832007a26dbe950512acbda4ed95b2a451 x_refsource_MISC
- https://github.com/evmos/ethermint/blob/c9d42d667b753147977a725e98ed116c933c76cb/x/evm/keeper/statedb.go#L199-L203 x_refsource_MISC