Skip to main content

CVE-2022-29219: CWE-190: Integer Overflow or Wraparound in ChainSafe lodestar

Medium
Published: Tue May 24 2022 (05/24/2022, 14:15:14 UTC)
Source: CVE
Vendor/Project: ChainSafe
Product: lodestar

Description

Lodestar is a TypeScript implementation of the Ethereum Consensus specification. Prior to version 0.36.0, there is a possible consensus split given maliciously-crafted `AttesterSlashing` or `ProposerSlashing` being included on-chain. Because the developers represent `uint64` values as native javascript `number`s, there is an issue when those variables with large (greater than 2^53) `uint64` values are included on chain. In those cases, Lodestar may view valid_`AttesterSlashing` or `ProposerSlashing` as invalid, due to rounding errors in large `number` values. This causes a consensus split, where Lodestar nodes are forked away from the main network. Similarly, Lodestar may consider invalid `ProposerSlashing` as valid, thus including in proposed blocks that will be considered invalid by the network. Version 0.36.0 contains a fix for this issue. As a workaround, use `BigInt` to represent `Slot` and `Epoch` values in `AttesterSlashing` and `ProposerSlashing` objects. `BigInt` is too slow to be used in all `Slot` and `Epoch` cases, so one may carefully use `BigInt` just where necessary for consensus.

AI-Powered Analysis

AILast updated: 06/23/2025, 08:20:21 UTC

Technical Analysis

CVE-2022-29219 is a medium-severity vulnerability affecting ChainSafe's Lodestar, a TypeScript implementation of the Ethereum Consensus specification. The issue arises from Lodestar's use of native JavaScript 'number' types to represent uint64 values such as 'Slot' and 'Epoch' in consensus-critical structures like 'AttesterSlashing' and 'ProposerSlashing'. JavaScript numbers are IEEE 754 double-precision floating-point values and can only safely represent integers up to 2^53-1. When uint64 values exceed this threshold, rounding errors occur, leading to integer overflow or wraparound (CWE-190). This causes Lodestar nodes to misinterpret valid slashings as invalid or invalid slashings as valid. Consequently, nodes running vulnerable versions (<0.36.0) may diverge from the canonical Ethereum consensus, resulting in a consensus split or forks away from the main network. This undermines the integrity and availability of the blockchain network. The vulnerability does not require authentication or user interaction but depends on maliciously crafted on-chain data. The fix, introduced in version 0.36.0, replaces the use of native numbers with JavaScript BigInt for these critical uint64 values, preventing rounding errors. However, BigInt is slower, so it is selectively applied only where necessary for consensus correctness. No known exploits have been reported in the wild. This vulnerability impacts the consensus layer of Ethereum clients using Lodestar, potentially causing network instability and loss of trust in block finality if exploited.

Potential Impact

For European organizations operating Ethereum validator nodes or infrastructure using the Lodestar client, this vulnerability poses a risk of consensus splits, which can lead to forks and inconsistent blockchain states. This undermines the availability and integrity of blockchain services, including decentralized finance (DeFi), token transactions, and smart contract execution. Financial institutions, blockchain service providers, and enterprises relying on Ethereum for critical operations may experience transaction delays, loss of funds, or reputational damage. The consensus split could also affect network reliability and increase operational costs due to the need for manual intervention or node resynchronization. While no exploits are known, the potential for malicious actors to craft slashings that trigger this behavior means European organizations must prioritize patching to maintain network stability and trust. The impact is particularly significant for organizations involved in staking or running validator nodes, as they are directly responsible for consensus participation.

Mitigation Recommendations

European organizations should immediately upgrade all Lodestar clients to version 0.36.0 or later to apply the official fix that replaces vulnerable number representations with BigInt for critical uint64 values. For environments where immediate upgrade is not feasible, a temporary workaround involves modifying the Lodestar codebase to use BigInt selectively for 'Slot' and 'Epoch' values in 'AttesterSlashing' and 'ProposerSlashing' objects, ensuring consensus correctness. Operators should audit their validator nodes and infrastructure to confirm no outdated versions are running. Additionally, monitoring tools should be enhanced to detect unusual consensus behavior or forks indicative of this vulnerability being triggered. Organizations should also coordinate with Ethereum network participants to share information about node versions and consensus health. Finally, incorporating automated testing for consensus-critical data handling can prevent regressions related to integer overflow issues in future updates.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-04-13T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9843c4522896dcbf2fd9

Added to database: 5/21/2025, 9:09:23 AM

Last enriched: 6/23/2025, 8:20:21 AM

Last updated: 7/30/2025, 12:50:41 AM

Views: 17

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats