Summary
Ethermint vulnerable to DoS through unintended Contract Selfdestruct
Vulnerability Report
Classification
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 function to destroy a smart contract.
Users Impacted
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.
Disclosure
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.
Additional Details
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:
- The malicious attacker identifies a vulnerable contract that can invoke
selfdestruct - The attacker deploys a copy of the contract with identical bytecode
- Finally, the attacker triggers the
selfdestructoperation 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).
Details
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.
Workarounds
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.
References
Are there any links users can visit to find out more?
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/ethermint
- Email us at [email protected] for security questions
- For Press, email us at [email protected].
Credits
Thanks to the
- Cronos Team: @yihuang and @tomtau for discovering the issue, @gakuzen-crypto, @polycryptics, @FinnZhangCrypto, @wilson-ang, @brianatcrypto for the impact analysis.
- Evmos Team: @facs95 for patching the issue and @fedekunze for managing the release and coordinating between teams.
Impact
Smart contract applications that make use of the selfdestruct functionality and their end-users.
CVE-2022-35936 has a CVSS score of 8.2 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.18.0, 7.0.0, 0.7.1-rc2); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Has the problem been patched? What versions should users upgrade to?
This vulnerability has been patched in Ethermint versions ≥v0.18.0. The patch has state machine-breaking changes for applications using Ethermint so a coordinated upgrade procedure is required.
Frequently Asked Questions
- What is CVE-2022-35936? CVE-2022-35936 is a high-severity security vulnerability in github.com/evmos/ethermint (go), affecting versions <= 0.17.2. It is fixed in 0.18.0, 7.0.0, 0.7.1-rc2.
- How severe is CVE-2022-35936? CVE-2022-35936 has a CVSS score of 8.2 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2022-35936?
github.com/evmos/ethermint(go) (versions <= 0.17.2)github.com/evmos/evmos(go) (versions <= 6.0.3)github.com/crypto-org-chain/cronos(go) (versions <= 0.7.0)github.com/Kava-Labs/kava(go) (versions <= 0.17.5)
- Is there a fix for CVE-2022-35936? Yes. CVE-2022-35936 is fixed in 0.18.0, 7.0.0, 0.7.1-rc2. Upgrade to this version or later.
- Is CVE-2022-35936 exploitable, and should I be worried? Whether CVE-2022-35936 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2022-35936 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2022-35936?
- Upgrade
github.com/evmos/ethermintto 0.18.0 or later - Upgrade
github.com/evmos/evmosto 7.0.0 or later - Upgrade
github.com/crypto-org-chain/cronosto 0.7.1-rc2 or later - Upgrade
github.com/Kava-Labs/kavato 0.18.0 or later
- Upgrade