CVE-2022-36025: Evm Besu VM Vulnerable To Gas Vulnerability
CRITICALCVE-2022-36025 is a CRITICAL (CVSS 9.1) besu vm vulnerable to gas vulnerability (CWE-681: Incorrect Conversion between Numeric Types) affecting Evm libraries in the Maven ecosystem. The issue involves besu vm vulnerable to gas allocation error in call operations. Remediation is available by upgrading affected packages to version 22.7.1.
CVE-2022-36025 at a Glance
Security Impact
CVSS: 9.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H).
How to Fix CVE-2022-36025
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.
<dependency>
<groupId>org.hyperledger.besu</groupId>
<artifactId>evm</artifactId>
<version>22.7.1</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.hyperledger.besu
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2022-36025, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.hyperledger.besu
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 22.7.1), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.hyperledger.besu command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-681: Incorrect Conversion between Numeric Types, where when converting from one data type to another, such as long to integer, data can be omitted or translated in a way that produces unexpected values. if the resulting values are used in a sensitive context, then dangerous behaviors may occur. 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-2022-36025 Affected Evm Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.hyperledger.besu:evm
|
Maven |
≥ 22.4.0-RC1
< 22.7.1
|
22.7.1
|
References
Frequently Asked Questions
What is CVE-2022-36025?
Which Evm versions are affected?
What version fixes CVE-2022-36025?
Is evm affected?
What is the CVSS score of CVE-2022-36025?
What CWE is associated with CVE-2022-36025?
How can I check Maven dependencies for CVE-2022-36025?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4456-w38r-m53x",
"modified" : "2022-09-23T20:24:21Z",
"published" : "2022-09-23T20:24:21Z",
"aliases" : [ "CVE-2022-36025" ],
"summary" : "Besu VM vulnerable to gas allocation error in CALL operations",
"details" : "### Impact\nAn error in 32 bit signed and unsigned types in the calculation of available gas in the CALL operations (including DELEGATECALL) results in incorrect gas being passed into called contracts and incorrect gas being returned after call execution. Where the amount of gas makes a difference in the success or failure, or if the gas is a negative 64 bit value, the execution will result in a different state root than expected, resulting in a consensus failure in networks with multiple EVM implementations. \n\nIn networks with a single EVM implementation this can be used to execute with significantly more gas than then transaction requested, possibly exceeding gas limitations. \n\n### Patches\nVersion 22.7.1 contains a fix, ensuring that excess gas will not be allocated to inner transaction calls and correcting the excess gas errors.\n\n### Workarounds\nReverting to version 22.1.3 or earlier will prevent incorrect execution. However many ethereum mainnet networks require changes in more recent versions of Besu and should not use older versions of besu and should instead use the patched version. \n\nEthereum Classic and other networks not depending on a Proof of Stake transition should function fine with version 22.1.3 or earlier.\n\n### For more information\nIssue was found by [Martin Holst Swende](https://github.com/holiman) using [goevmlab](https://github.com/holiman/goevmlab), it is believed that no production networks have transactions that would trigger this failure.\n\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.hyperledger.besu:evm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "22.4.0-RC1"
}, {
"fixed" : "22.7.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/hyperledger/besu/security/advisories/GHSA-4456-w38r-m53x"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-36025"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/hyperledger/besu"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-196", "CWE-681" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-09-23T20:24:21Z",
"nvd_published_at" : "2022-09-24T02:15:00Z"
}
}