CVE-2022-36025
Besu VM vulnerable to gas allocation error in CALL operations
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.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.hyperledger.besu » evm | >= 22.4.0-RC1, < 22.7.1 | 22.7.1 |
Blast radius
4% of the dependent artifacts (1) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 179 |
| 2 hops | 40 |
Most used dependents
- org.hyperledger.besu.internal » core29 usages
- org.hyperledger.besu.internal » api18 usages
- org.hyperledger.besu.internal » p2p15 usages
- org.hyperledger.besu.internal » eth14 usages
- org.hyperledger.besu.internal » blockcreation13 usages
- org.hyperledger.besu.internal » common8 usages
- org.hyperledger.besu.internal » besu6 usages
- org.hyperledger.besu.internal » permissioning5 usages
- org.hyperledger.besu.internal » clique4 usages
- org.hyperledger.besu.internal » ibft4 usages
- org.hyperledger.besu.internal » merge3 usages
- org.hyperledger.besu.internal » qbft3 usages
- org.hyperledger.besu.internal » ibftlegacy2 usages
- org.hyperledger.besu.internal » referencetests2 usages
- org.hyperledger.besu.internal » ethstats1 usages
Computed from the dependency graph of build 20261203.1441 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
| Advisory | NVD CVE-2022-36025 | nvd.nist.gov |
| Package | hyperledger/besu | github.com |
| Web | hyperledger/besu advisory GHSA-4456-w38r-m53x | github.com |
