CVE-2021-29511 Memory over-allocation in evm crate

Medium 6.5 Published Updated

An attacker can cause denial of service by triggering excessive memory allocation in the evm crate via specific EVM opcodes.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-29511?

CVE-2021-29511 is a medium-severity denial of service vulnerability in rust-blockchain evm, published on 12 May 2021. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

evm is a pure Rust implementation of Ethereum Virtual Machine. Prior to the patch, when executing specific EVM opcodes related to memory operations that use `evm_core::Memory::copy_large`, the `evm` crate can over-allocate memory when it is not needed, making it possible for an attacker to perform denial-of-service attack. The flaw was corrected in commit `19ade85`. Users should upgrade to `==0.21.1, ==0.23.1, ==0.24.1, ==0.25.1, >=0.26.1`. There are no workarounds. Please upgrade your `evm` crate version.

Weakness: CWE-787, CWE-770

Which versions are affected by CVE-2021-29511?

24 open source packages ship an affected version, including evm and evm-core. It affects 1 product.

PackageAffectedFixed in
evm crates.ioAll versions0.21.1
evm crates.ioAll versions0.21.1
evm crates.ioFrom 0.22.00.22.1
evm crates.ioFrom 0.22.00.22.1
evm crates.ioFrom 0.23.00.23.1
evm crates.ioFrom 0.23.00.23.1
18 more packages
evm crates.ioFrom 0.24.00.24.1
evm crates.ioFrom 0.24.00.24.1
evm crates.ioFrom 0.25.00.25.1
evm crates.ioFrom 0.25.00.25.1
evm crates.ioFrom 0.26.00.26.1
evm crates.ioFrom 0.26.00.26.1
evm-core crates.ioAll versions0.21.1
evm-core crates.ioAll versions0.21.1
evm-core crates.ioFrom 0.22.00.22.1
evm-core crates.ioFrom 0.22.00.22.1
evm-core crates.ioFrom 0.23.00.23.1
evm-core crates.ioFrom 0.23.00.23.1
evm-core crates.ioFrom 0.24.00.24.1
evm-core crates.ioFrom 0.24.00.24.1
evm-core crates.ioFrom 0.25.00.25.1
evm-core crates.ioFrom 0.25.00.25.1
evm-core crates.ioFrom 0.26.00.26.1
evm-core crates.ioFrom 0.26.00.26.1

Products include Evm Project Evm.

How do I fix CVE-2021-29511?

Upgrade evm to a fixed version for your release line: 0.21.1, 0.22.1, 0.23.1 or 0.24.1.

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-2021-29511 being exploited?

There is no known exploitation of CVE-2021-29511 in the wild and no public exploit code.

Sources

Also known as GHSA-4jwq-572w-4388.

Is CVE-2021-29511 in your software?

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

Check your SBOMs for free