Vulnerabilities in pkg:npm/@chainsafe/lodestar
PACKAGECVE-2022-29219 is a HIGH (CVSS 7.5) attesterslashing number overflow vulnerability (CWE-190: Integer Overflow or Wraparound) affecting @chainsafe/lodestar libraries in the npm ecosystem. The issue involves attesterslashing number overflow. Remediation is available by upgrading affected packages to version 0.36.0.
pkg:npm/@chainsafe/lodestar
Vulnerability advisories affecting package pkg:npm/@chainsafe/lodestar. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-cvj7-5f3c-9vg9 | CVE-2022-29219 | HIGH | AttesterSlashing number overflow |
CVE-2022-29219 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2022-29219
To remediate this vulnerability, upgrade all affected @chainsafe/lodestar dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @chainsafe/lodestar@0.36.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @chainsafe/lodestar
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-29219, inspect your project dependencies using npm:
npm ls @chainsafe/lodestar
Analyze the terminal output to locate any version of @chainsafe/lodestar in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.36.0), your application is affected.
Note: The npm ls @chainsafe/lodestar command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. In @chainsafe/lodestar, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-29219 Affected @chainsafe/lodestar Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@chainsafe/lodestar
|
npm |
< 0.36.0
|
0.36.0
|
References
Frequently Asked Questions
What is CVE-2022-29219?
Which @chainsafe/lodestar versions are affected?
What version fixes CVE-2022-29219?
Is @chainsafe/lodestar affected?
What is the CVSS score of CVE-2022-29219?
What CWE is associated with CVE-2022-29219?
How can I check npm dependencies for CVE-2022-29219?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cvj7-5f3c-9vg9",
"modified" : "2022-05-24T22:21:10Z",
"published" : "2022-05-24T22:21:10Z",
"aliases" : [ "CVE-2022-29219" ],
"summary" : "AttesterSlashing number overflow",
"details" : "### Impact\n\nPossible consensus split given maliciously-crafted `AttesterSlashing` or `ProposerSlashing` being included on-chain.\n\nSince we 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.\n\nSimilarly Lodestar may consider _invalid_ `ProposerSlashing` as _valid_, thus including in proposed blocks that will be considered invalid by the network.\n\n### Patches\n\nhttps://github.com/ChainSafe/lodestar/pull/3977\n\n### Workarounds\n\nUse `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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@chainsafe/lodestar"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.36.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ChainSafe/lodestar/security/advisories/GHSA-cvj7-5f3c-9vg9"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-29219"
}, {
"type" : "WEB",
"url" : "https://github.com/ChainSafe/lodestar/pull/3977"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ChainSafe/lodestar"
}, {
"type" : "WEB",
"url" : "https://github.com/ChainSafe/lodestar/releases/tag/v0.36.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-190" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-05-24T22:21:10Z",
"nvd_published_at" : "2022-05-24T15:15:00Z"
}
}