Skip to content

Besu VM vulnerable to gas allocation error in CALL operations

Critical severity GitHub Reviewed Published Sep 23, 2022 in hyperledger/besu • Updated Jan 28, 2023

Package

maven org.hyperledger.besu:evm (Maven)

Affected versions

>= 22.4.0-RC1, < 22.7.1

Patched versions

22.7.1

Description

Impact

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

In networks with a single EVM implementation this can be used to execute with significantly more gas than then transaction requested, possibly exceeding gas limitations.

Patches

Version 22.7.1 contains a fix, ensuring that excess gas will not be allocated to inner transaction calls and correcting the excess gas errors.

Workarounds

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

Ethereum Classic and other networks not depending on a Proof of Stake transition should function fine with version 22.1.3 or earlier.

For more information

Issue was found by Martin Holst Swende using goevmlab, it is believed that no production networks have transactions that would trigger this failure.

References

@garyschulte garyschulte published to hyperledger/besu Sep 23, 2022
Published to the GitHub Advisory Database Sep 23, 2022
Reviewed Sep 23, 2022
Published by the National Vulnerability Database Sep 24, 2022
Last updated Jan 28, 2023

Severity

Critical

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
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
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:N/UI:N/S:U/C:N/I:H/A:H

EPSS score

0.094%
(42nd percentile)

CVE ID

CVE-2022-36025

GHSA ID

GHSA-4456-w38r-m53x

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.