CVE-2022-35936 Ethermint DoS through Unintended Contract Selfdestruct

High 8.2 Published Updated

Attackers can cause denial of service for multiple contracts sharing bytecode by triggering selfdestruct on one, affecting Ethermint users.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2022-35936?

CVE-2022-35936 is a high-severity denial of service vulnerability in evmos ethermint, published on 5 Aug 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

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.

Weakness: CWE-668

Which versions are affected by CVE-2022-35936?

18 open source packages ship an affected version, including github.com/evmos/ethermint, github.com/Kava-Labs/kava and github.com/crypto-org-chain/cronos. It affects 4 products.

PackageAffectedFixed in
github.com/evmos/ethermint GoAll versions0.18.0
github.com/evmos/ethermint GoAll versions0.18.0
github.com/evmos/ethermint GoAll versions0.18.0
github.com/Kava-Labs/kava GoAll versions0.18.0
github.com/Kava-Labs/kava GoAll versions0.18.0
github.com/crypto-org-chain/cronos GoAll versions0.7.1-rc2
12 more packages
github.com/crypto-org-chain/cronos GoAll versions0.7.1-rc2
github.com/crypto-org-chain/cronos GoAll versions0.7.1-rc2
github.com/evmos/evmos GoAll versionsNone
github.com/evmos/evmos GoAll versions7.0.0
github.com/evmos/evmos GoAll versions7.0.0
github.com/evmos/evmos/v2 GoAll versionsNone
github.com/evmos/evmos/v3 GoAll versionsNone
github.com/evmos/evmos/v4 GoAll versionsNone
github.com/evmos/evmos/v5 GoAll versionsNone
github.com/evmos/evmos/v6 GoAll versionsNone
github.com/evmos/evmos/v7 GoAll versions7.0.0
github.com/kava-labs/kava GoAll versions0.18.0

Products include Crypto Cronos, Evmos Ethermint, Evmos Evmos, Kava Kava.

How do I fix CVE-2022-35936?

Upgrade github.com/evmos/ethermint to 0.18.0 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2022-35936 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-35936 exists.

Sources

Also known as GHSA-f92v-grc2-w2fg, GO-2022-0760.

Is CVE-2022-35936 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free