CVE-2022-31111: CWE-670: Always-Incorrect Control Flow Implementation in paritytech frontier
Frontier is Substrate's Ethereum compatibility layer. In affected versions 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. It is recommended that an emergency upgrade to be planned and EVM execution temporarily paused in the mean time. The issue is patched in Frontier master branch commit fed5e0a9577c10bea021721e8c2c5c378e16bf66 and polkadot-v0.9.22 branch commit e3e427fa2e5d1200a784679f8015d4774cedc934. 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.
AI Analysis
Technical Summary
CVE-2022-31111 is a medium-severity vulnerability affecting paritytech's Frontier, which is the Ethereum compatibility layer built on top of the Substrate blockchain framework. The vulnerability arises from an incorrect implementation of truncation logic when converting balances between the Ethereum Virtual Machine (EVM) balance type and the native Substrate balance type. Specifically, the truncation process that should ensure consistent representation of token amounts between these two systems is flawed, resulting in discrepancies between the apparent EVM transfer value and the actual amount transferred on the Substrate layer. This inconsistency can lead to incorrect internal EVM state balances, although the native Substrate balance states and the node itself remain unaffected. The root cause is classified under CWE-670, indicating an always-incorrect control flow implementation, which suggests that the truncation logic consistently fails under all conditions rather than intermittently. The vulnerability was addressed in Frontier's master branch with commit fed5e0a9577c10bea021721e8c2c5c378e16bf66 and in the polkadot-v0.9.22 branch with commit e3e427fa2e5d1200a784679f8015d4774cedc934. Until these patches are applied, it is recommended to temporarily pause EVM execution by configuring a Substrate CallFilter to disable calls to the pallet-evm and pallet-ethereum modules, preventing exploitation of the flawed truncation logic. No known exploits have been reported in the wild, and the vulnerability impacts only the internal EVM state, not the underlying Substrate balances or node operations.
Potential Impact
For European organizations utilizing blockchain infrastructure based on Substrate with Frontier as the Ethereum compatibility layer, this vulnerability could lead to inconsistencies in token accounting within the EVM environment. This may cause financial discrepancies, undermine trust in smart contract executions, and potentially disrupt decentralized finance (DeFi) applications or other blockchain-based services relying on accurate token transfers. Although the native Substrate balances remain intact, the divergence in EVM internal states could be exploited to manipulate perceived token holdings or transfer amounts within EVM-based applications, potentially leading to financial loss or erroneous contract behavior. Organizations operating validator nodes, blockchain service providers, or enterprises integrating Substrate-based blockchains with Ethereum compatibility in Europe could face operational risks and reputational damage if the vulnerability is exploited. The impact is particularly relevant for entities involved in financial services, supply chain management, or digital asset custody that depend on precise token accounting and cross-chain interoperability.
Mitigation Recommendations
Immediate mitigation involves temporarily pausing EVM execution by configuring a Substrate CallFilter to disable the pallet-evm and pallet-ethereum calls, effectively preventing any EVM transactions until the patch can be applied. Organizations should plan and execute an emergency upgrade to the patched versions of Frontier, specifically incorporating the fixes from commits fed5e0a9577c10bea021721e8c2c5c378e16bf66 (master branch) or e3e427fa2e5d1200a784679f8015d4774cedc934 (polkadot-v0.9.22 branch). It is critical to verify the integrity and authenticity of the patch before deployment. Additionally, after patching, thorough reconciliation of EVM internal balances with Substrate balances should be performed to detect and correct any discrepancies caused prior to the fix. Monitoring and alerting should be enhanced around EVM transaction anomalies and balance inconsistencies. For organizations running multi-node or multi-chain environments, coordinated patching and testing are essential to avoid network partition or consensus issues. Finally, reviewing and strengthening testing procedures for balance conversions and control flow implementations in blockchain modules can prevent similar issues in the future.
Affected Countries
Germany, France, Netherlands, Switzerland, United Kingdom, Estonia, Luxembourg
CVE-2022-31111: CWE-670: Always-Incorrect Control Flow Implementation in paritytech frontier
Description
Frontier is Substrate's Ethereum compatibility layer. In affected versions 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. It is recommended that an emergency upgrade to be planned and EVM execution temporarily paused in the mean time. The issue is patched in Frontier master branch commit fed5e0a9577c10bea021721e8c2c5c378e16bf66 and polkadot-v0.9.22 branch commit e3e427fa2e5d1200a784679f8015d4774cedc934. 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.
AI-Powered Analysis
Technical Analysis
CVE-2022-31111 is a medium-severity vulnerability affecting paritytech's Frontier, which is the Ethereum compatibility layer built on top of the Substrate blockchain framework. The vulnerability arises from an incorrect implementation of truncation logic when converting balances between the Ethereum Virtual Machine (EVM) balance type and the native Substrate balance type. Specifically, the truncation process that should ensure consistent representation of token amounts between these two systems is flawed, resulting in discrepancies between the apparent EVM transfer value and the actual amount transferred on the Substrate layer. This inconsistency can lead to incorrect internal EVM state balances, although the native Substrate balance states and the node itself remain unaffected. The root cause is classified under CWE-670, indicating an always-incorrect control flow implementation, which suggests that the truncation logic consistently fails under all conditions rather than intermittently. The vulnerability was addressed in Frontier's master branch with commit fed5e0a9577c10bea021721e8c2c5c378e16bf66 and in the polkadot-v0.9.22 branch with commit e3e427fa2e5d1200a784679f8015d4774cedc934. Until these patches are applied, it is recommended to temporarily pause EVM execution by configuring a Substrate CallFilter to disable calls to the pallet-evm and pallet-ethereum modules, preventing exploitation of the flawed truncation logic. No known exploits have been reported in the wild, and the vulnerability impacts only the internal EVM state, not the underlying Substrate balances or node operations.
Potential Impact
For European organizations utilizing blockchain infrastructure based on Substrate with Frontier as the Ethereum compatibility layer, this vulnerability could lead to inconsistencies in token accounting within the EVM environment. This may cause financial discrepancies, undermine trust in smart contract executions, and potentially disrupt decentralized finance (DeFi) applications or other blockchain-based services relying on accurate token transfers. Although the native Substrate balances remain intact, the divergence in EVM internal states could be exploited to manipulate perceived token holdings or transfer amounts within EVM-based applications, potentially leading to financial loss or erroneous contract behavior. Organizations operating validator nodes, blockchain service providers, or enterprises integrating Substrate-based blockchains with Ethereum compatibility in Europe could face operational risks and reputational damage if the vulnerability is exploited. The impact is particularly relevant for entities involved in financial services, supply chain management, or digital asset custody that depend on precise token accounting and cross-chain interoperability.
Mitigation Recommendations
Immediate mitigation involves temporarily pausing EVM execution by configuring a Substrate CallFilter to disable the pallet-evm and pallet-ethereum calls, effectively preventing any EVM transactions until the patch can be applied. Organizations should plan and execute an emergency upgrade to the patched versions of Frontier, specifically incorporating the fixes from commits fed5e0a9577c10bea021721e8c2c5c378e16bf66 (master branch) or e3e427fa2e5d1200a784679f8015d4774cedc934 (polkadot-v0.9.22 branch). It is critical to verify the integrity and authenticity of the patch before deployment. Additionally, after patching, thorough reconciliation of EVM internal balances with Substrate balances should be performed to detect and correct any discrepancies caused prior to the fix. Monitoring and alerting should be enhanced around EVM transaction anomalies and balance inconsistencies. For organizations running multi-node or multi-chain environments, coordinated patching and testing are essential to avoid network partition or consensus issues. Finally, reviewing and strengthening testing procedures for balance conversions and control flow implementations in blockchain modules can prevent similar issues in the future.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2022-05-18T00:00:00.000Z
- Cisa Enriched
- true
Threat ID: 682d9844c4522896dcbf36ce
Added to database: 5/21/2025, 9:09:24 AM
Last enriched: 6/23/2025, 3:05:38 AM
Last updated: 7/30/2025, 9:29:17 PM
Views: 10
Related Threats
CVE-2025-43201: An app may be able to unexpectedly leak a user's credentials in Apple Apple Music Classical for Android
UnknownCVE-2025-8959: CWE-59: Improper Link Resolution Before File Access (Link Following) in HashiCorp Shared library
HighCVE-2025-44201
LowCVE-2025-36088: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in IBM Storage TS4500 Library
MediumCVE-2025-43490: CWE-59 Improper Link Resolution Before File Access ('Link Following') in HP, Inc. HP Hotkey Support Software
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.