CVE-2021-29511: Evm Memory Over-allocation Vulnerability
MODERATECVE-2021-29511 is a MODERATE (CVSS 6.5) memory over-allocation vulnerability (CWE-787: Out-of-bounds Write) affecting Evm libraries in the crates.io ecosystem. The issue involves memory over-allocation in evm crate. Remediation is available by upgrading affected packages to version 0.25.1, 0.26.1, 0.21.1, 0.22.1, 0.23.1, 0.24.1.
CVE-2021-29511 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2021-29511
To remediate this vulnerability, upgrade all affected Evm dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade evm to 0.25.1
Upgrade evm to 0.26.1
Upgrade evm to 0.21.1
Upgrade evm-core to 0.21.1
Upgrade evm to 0.22.1
Upgrade evm to 0.23.1
Upgrade evm to 0.24.1
Upgrade evm-core to 0.22.1
Upgrade evm-core to 0.23.1
Upgrade evm-core to 0.24.1
Upgrade evm-core to 0.25.1
Upgrade evm-core to 0.26.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for evm
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-29511, inspect your project dependencies for Evm:
inspect dependencies for evm
Analyze the terminal output to locate any version of Evm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.25.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-787: Out-of-bounds Write, where the product writes data past the end, or before the beginning, of the intended buffer. In Evm, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-29511 Affected Evm Versions
12 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
evm
|
crates.io |
≥ 0.25.0
< 0.25.1
All 1 versions
0.25.0
|
0.25.1
|
|
evm
|
crates.io |
≥ 0.26.0
< 0.26.1
All 1 versions
0.26.0
|
0.26.1
|
|
evm
|
crates.io |
< 0.21.1
|
0.21.1
|
|
evm-core
|
crates.io |
< 0.21.1
|
0.21.1
|
|
evm
|
crates.io |
≥ 0.22.0
< 0.22.1
All 1 versions
0.22.0
|
0.22.1
|
|
evm
|
crates.io |
≥ 0.23.0
< 0.23.1
All 1 versions
0.23.0
|
0.23.1
|
|
evm
|
crates.io |
≥ 0.24.0
< 0.24.1
All 1 versions
0.24.0
|
0.24.1
|
|
evm-core
|
crates.io |
≥ 0.22.0
< 0.22.1
All 1 versions
0.22.0
|
0.22.1
|
|
evm-core
|
crates.io |
≥ 0.23.0
< 0.23.1
All 1 versions
0.23.0
|
0.23.1
|
|
evm-core
|
crates.io |
≥ 0.24.0
< 0.24.1
All 1 versions
0.24.0
|
0.24.1
|
|
evm-core
|
crates.io |
≥ 0.25.0
< 0.25.1
All 1 versions
0.25.0
|
0.25.1
|
|
evm-core
|
crates.io |
≥ 0.26.0
< 0.26.1
All 1 versions
0.26.0
|
0.26.1
|
References
Frequently Asked Questions
What is CVE-2021-29511?
Which Evm versions are affected?
What version fixes CVE-2021-29511?
Is evm affected?
Is evm-core affected?
What is the CVSS score of CVE-2021-29511?
What CWE is associated with CVE-2021-29511?
How can I check crates.io dependencies for CVE-2021-29511?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4jwq-572w-4388",
"modified" : "2024-01-30T23:55:38Z",
"published" : "2024-01-30T23:55:38Z",
"aliases" : [ "CVE-2021-29511" ],
"summary" : "Memory over-allocation in evm crate",
"details" : "### Impact\nPrior 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.\n\n### Patches\nThe 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`.\n\n### Workarounds\nNone. Please upgrade your `evm` crate version\n\n### References\nFix commit: https://github.com/rust-blockchain/evm/commit/19ade858c430ab13eb562764a870ac9f8506f8dd\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [evm repo](https://github.com/rust-blockchain/evm)\n* Email [Wei](mailto:wei@that.world)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "evm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.21.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.21.0"
}
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "evm-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.21.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.21.0"
}
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "evm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.22.0"
}, {
"fixed" : "0.22.1"
} ]
} ],
"versions" : [ "0.22.0" ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "evm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.23.0"
}, {
"fixed" : "0.23.1"
} ]
} ],
"versions" : [ "0.23.0" ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "evm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.24.0"
}, {
"fixed" : "0.24.1"
} ]
} ],
"versions" : [ "0.24.0" ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "evm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.25.0"
}, {
"fixed" : "0.25.1"
} ]
} ],
"versions" : [ "0.25.0" ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "evm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.26.0"
}, {
"fixed" : "0.26.1"
} ]
} ],
"versions" : [ "0.26.0" ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "evm-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.22.0"
}, {
"fixed" : "0.22.1"
} ]
} ],
"versions" : [ "0.22.0" ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "evm-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.23.0"
}, {
"fixed" : "0.23.1"
} ]
} ],
"versions" : [ "0.23.0" ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "evm-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.24.0"
}, {
"fixed" : "0.24.1"
} ]
} ],
"versions" : [ "0.24.0" ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "evm-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.25.0"
}, {
"fixed" : "0.25.1"
} ]
} ],
"versions" : [ "0.25.0" ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "evm-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.26.0"
}, {
"fixed" : "0.26.1"
} ]
} ],
"versions" : [ "0.26.0" ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/rust-blockchain/evm/security/advisories/GHSA-4jwq-572w-4388"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-29511"
}, {
"type" : "WEB",
"url" : "https://github.com/rust-blockchain/evm/commit/19ade858c430ab13eb562764a870ac9f8506f8dd"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-770", "CWE-787" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-01-30T23:55:38Z",
"nvd_published_at" : "2021-05-12T18:15:00Z"
}
}