Skip to content

Memory over-allocation in evm crate

Moderate severity GitHub Reviewed Published May 11, 2021 in rust-ethereum/evm • Updated Jan 30, 2024

Package

cargo evm (Rust)

Affected versions

<= 0.21.0
= 0.22.0
= 0.23.0
= 0.24.0
= 0.25.0
= 0.26.0

Patched versions

0.21.1
0.22.1
0.23.1
0.24.1
0.25.1
0.26.1
cargo evm-core (Rust)
<= 0.21.0
= 0.22.0
= 0.23.0
= 0.24.0
= 0.25.0
= 0.26.0
0.21.1
0.22.1
0.23.1
0.24.1
0.25.1
0.26.1

Description

Impact

Prior to the patch, when executing specific EVM opcodes related to memory operations that use evm_core::Memory::copy_large, the crate can over-allocate memory when it is not needed, making it possible for an attacker to perform denial-of-service attack.

Patches

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.

Workarounds

None. Please upgrade your evm crate version

References

Fix commit: rust-ethereum/evm@19ade85

For more information

If you have any questions or comments about this advisory:

References

@sorpaas sorpaas published to rust-ethereum/evm May 11, 2021
Published by the National Vulnerability Database May 12, 2021
Published to the GitHub Advisory Database Jan 30, 2024
Reviewed Jan 30, 2024
Last updated Jan 30, 2024

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

EPSS score

0.137%
(51st percentile)

CVE ID

CVE-2021-29511

GHSA ID

GHSA-4jwq-572w-4388

Source code

No known source code
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.