VYPR
Moderate severityNVD Advisory· Published May 12, 2021· Updated Aug 3, 2024

Memory over-allocation in evm crate

CVE-2021-29511

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.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

evm crate memory over-allocation via specific opcodes leading to DoS; fixed in versions 0.21.1, 0.23.1, 0.24.1, 0.25.1, 0.26.1+.

Vulnerability

In the evm crate (Rust Ethereum Virtual Machine) prior to the patch, the evm_core::Memory::copy_large function can over-allocate memory when it is not needed. This occurs when executing specific EVM opcodes related to memory operations. The flaw was present in versions before the fix commit 19ade85 [1][2][3].

Exploitation

An attacker can craft EVM opcodes that trigger the copy_large function with an empty value vector, causing the crate to unnecessarily allocate memory. No authentication or special privileges are required; the attacker only needs to submit malicious bytecode to a system using the vulnerable evm crate [1][3].

Impact

Successful exploitation leads to a denial-of-service (DoS) condition due to excessive memory allocation, potentially exhausting system resources and crashing the application [1][3].

Mitigation

The fix was applied in commit 19ade85 [2]. Users should upgrade to versions ==0.21.1, ==0.23.1, ==0.24.1, ==0.25.1, or >=0.26.1 [1][3]. There are no workarounds; upgrading is the only remediation [1][3].

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
evmcrates.io
< 0.21.10.21.1
evm-corecrates.io
< 0.21.10.21.1
evmcrates.io
>= 0.22.0, < 0.22.10.22.1
evmcrates.io
>= 0.23.0, < 0.23.10.23.1
evmcrates.io
>= 0.24.0, < 0.24.10.24.1
evmcrates.io
>= 0.25.0, < 0.25.10.25.1
evmcrates.io
>= 0.26.0, < 0.26.10.26.1
evm-corecrates.io
>= 0.22.0, < 0.22.10.22.1
evm-corecrates.io
>= 0.23.0, < 0.23.10.23.1
evm-corecrates.io
>= 0.24.0, < 0.24.10.24.1
evm-corecrates.io
>= 0.25.0, < 0.25.10.25.1
evm-corecrates.io
>= 0.26.0, < 0.26.10.26.1

Affected products

3

Patches

1
19ade858c430

Skip setting memory value if the value vec is empty

https://github.com/rust-blockchain/evmWei TangMay 11, 2021via ghsa
1 file changed · +4 0
  • core/src/memory.rs+4 0 modified
    @@ -105,6 +105,10 @@ impl Memory {
     		value: &[u8],
     		target_size: Option<usize>
     	) -> Result<(), ExitFatal> {
    +		if value.is_empty() {
    +			return Ok(())
    +		}
    +		
     		let target_size = target_size.unwrap_or(value.len());
     
     		if offset.checked_add(target_size)
    

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

5

News mentions

0

No linked articles in our index yet.