Buffer Overflow Affecting @chainsafe/lodestar package, versions <0.36.0


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.07% (33rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-CHAINSAFELODESTAR-2847914
  • published25 May 2022
  • disclosed24 May 2022
  • creditUnknown

Introduced: 24 May 2022

CVE-2022-29219  (opens in a new tab)
CWE-190  (opens in a new tab)

How to fix?

Upgrade @chainsafe/lodestar to version 0.36.0 or higher.

Overview

@chainsafe/lodestar is an A Typescript implementation of the beacon chain

Affected versions of this package are vulnerable to Buffer Overflow. Possible consensus split given maliciously-crafted AttesterSlashing or ProposerSlashing being included on-chain.

The library represents uint64 values as native javascript numbers, causing 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.

Workarounds

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 use BigInt only when necessary for consensus.

References

CVSS Scores

version 3.1