Ethermint vulnerable to DoS through unintended Contract Selfdestruct
# Vulnerability Report
Smart contract applications that make use of the selfdestruct functionality and their end-users.
The vulnerability has been classified as high with a CVSS score of 8.2. It has the potential to create a denial-of-service to all contracts that can invoke the [selfdestruct](https://ethereum.stackexchange.com/questions/315/why-are-selfdestructs-used-in-contract-programming#347) function to destroy a smart contract.
Due to the successfully coordinated security vulnerability disclosure, no smart contracts were impacted through the use of this vulnerability. Smart contract states and storage values are not affected by this vulnerability. User funds and balances are safe.
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](https://github.com/evmos/ethermint/blob/c9d42d667b753147977a725e98ed116c933c76cb/x/evm/keeper/statedb.go#L199-L203) 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.
The same contract bytecode can be deployed multiple times to create multiple contract instances. In the internal database, the bytecode is stored as a key-value entry bytecode hash --> bytecode which is shared by those contracts. Unfortunately, when one of the contracts invokes selfdestruct, it will remove the corresponding bytecode hash -> bytecode entry, and thus it disables all the contracts that share the same bytecode.
The attack scenario is as follows:
1. The malicious attacker identifies a vulnerable contract that can invoke selfdestruct
2. The attacker deploys a copy of the contract with identical bytecode
3. Finally, the attacker triggers the selfdestruct operation on their redeployed contract, actively causing a DoS on the original and vulnerable contract. All transactions will fail until a workaround is used (see below).
*Has the problem been patched? What versions should users upgrade to?*
This vulnerability has been patched in Ethermint versions ≥[v0.18.0](https://github.com/evmos/ethermint/releases/tag/v0.18.0). The patch has state machine-breaking changes for applications using Ethermint so a coordinated upgrade procedure is required.
The patch removes the bytecode deletion logic, i.e. contract bytecodes are never deleted from the internal database after the patch.
At the moment, Ethermint does not track how many times each bytecode is used, and thus it cannot determine if it is safe to delete a particular bytecode on selfdestruct invocations. This behavior is the same with go-ethereum.
_Is there a way for users to fix or remediate the vulnerability without upgrading?_
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.
*Are there any links users can visit to find out more?*
If you have any questions or comments about this advisory:
Thanks to the
This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity low, availability high.
The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
CVE-2022-35936 is classified as CWE-668: Exposure of Resource to Wrong Sphere. A resource is made reachable from a context that should not have access to it.
CVE-2022-35936 is recorded against 14 packages.
Published on 5 August 2022 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from NVD.
github.com
github.com
github.com
github.com
github.com
github.com
These advisories are the same class of weakness (CWE-668: Exposure of Resource to Wrong Sphere) in other software:
Details
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| cronos | — | 0.7.0 |
| ethermint | — | 0.18.0 |
| evmos | — | 7.0.0 |
| github.com/crypto-org-chain/cronos | — | — |
| github.com/evmos/ethermint | — | — |
| github.com/evmos/evmos | — | — |
| github.com/evmos/evmos/v2 | — | — |
| github.com/evmos/evmos/v3 | — | — |
| github.com/evmos/evmos/v4 | — | — |
| github.com/evmos/evmos/v5 | — | — |
| github.com/evmos/evmos/v6 | — | — |
| github.com/evmos/evmos/v7 | — | — |
| github.com/kava-labs/kava | — | — |
| kava | — | 0.18.0 |
References
Similar Threats
Exploit Protection
CVE-2022-35936 carries CVSS 8.2 High rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.
Check My Site For CVE-2022-35936 →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.