GHSA-cvj7-5f3c-9vg9

Suggest an improvement
Source
https://github.com/advisories/GHSA-cvj7-5f3c-9vg9
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/05/GHSA-cvj7-5f3c-9vg9/GHSA-cvj7-5f3c-9vg9.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-cvj7-5f3c-9vg9
Aliases
Published
2022-05-24T22:21:10Z
Modified
2023-11-01T04:58:42.896002Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N CVSS Calculator
Summary
AttesterSlashing number overflow
Details

Impact

Possible consensus split given maliciously-crafted AttesterSlashing or ProposerSlashing being included on-chain.

Since we represent uint64 values as native javascript numbers, 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.

Patches

https://github.com/ChainSafe/lodestar/pull/3977

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 we will carefully use BigInt just where necessary for consensus.

Database specific
{
    "cwe_ids": [
        "CWE-190"
    ],
    "github_reviewed": true,
    "severity": "HIGH",
    "nvd_published_at": "2022-05-24T15:15:00Z",
    "github_reviewed_at": "2022-05-24T22:21:10Z"
}
References

Affected packages

npm / @chainsafe/lodestar

Package

Name
@chainsafe/lodestar
View open source insights on deps.dev
Purl
pkg:npm/%40chainsafe/lodestar

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.36.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/05/GHSA-cvj7-5f3c-9vg9/GHSA-cvj7-5f3c-9vg9.json"