Skip to content

Discrepency between appeared EVM transfer value and actual value due to incorrect truncation

High
sorpaas published GHSA-hc8w-mx86-9fcj Jul 6, 2022

Package

cargo Frontier (Rust)

Affected versions

<= commit f6fff7f3c33e0b4a8ed72acb4fc7888fbeb8e7fc

Patched versions

commit fed5e0a9577c10bea021721e8c2c5c378e16bf66

Description

Impact

The truncation done when converting between EVM balance type and Substrate balance type was incorrectly implemented. This leads to possible discrepancy between appeared EVM transfer value and actual Substrate value transferred. This is a high severity vulnerability because it affects EVM contracts that reads EVM transfer values in their codes including DEX and ERC20 tokens. It is recommended that an emergency upgrade to be planned and EVM execution temporarily paused in the mean time.

Patches

The issue is patched in Frontier master branch commit fed5e0a and polkadot-v0.9.22 branch commit e3e427f

Workarounds

This vulnerability affects only EVM internal states, but not Substrate balance states or node. You can temporarily pause EVM execution (by setting up a Substrate CallFilter that disables pallet-evm and pallet-ethereum calls) before the patch can be applied.

References

Fix PR: #753

For more information

If you have any questions or comments about this advisory:

Severity

High

CVE ID

CVE-2022-31111

Weaknesses

No CWEs