Vulnerabilities in pkg:npm/cumulative-distribution-function
PACKAGECVE-2021-29486 is a HIGH (CVSS 7.5) cumulative-distribution-function infinite loop vulnerability vulnerability (CWE-20: Improper Input Validation) affecting Cumulative distribution function libraries in the npm ecosystem. The issue involves cumulative-distribution-function infinite loop vulnerability. Remediation is available by upgrading affected packages to version 2.0.0.
pkg:npm/cumulative-distribution-function
Vulnerability advisories affecting package pkg:npm/cumulative-distribution-function. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-58qp-5328-v7mh | CVE-2021-29486 | HIGH | cumulative-distribution-function Infinite Loop vulnerability |
CVE-2021-29486 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:N/A:H).
How to Fix CVE-2021-29486
To remediate this vulnerability, upgrade all affected Cumulative distribution function 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 cumulative-distribution-function@2.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls cumulative-distribution-function
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-29486, inspect your project dependencies using npm:
npm ls cumulative-distribution-function
Analyze the terminal output to locate any version of Cumulative distribution function in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.0), your application is affected.
Note: The npm ls cumulative-distribution-function 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Cumulative distribution function, 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-2021-29486 Affected Cumulative distribution function Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
cumulative-distribution-function
|
npm |
< 2.0.0
|
2.0.0
|
References
Frequently Asked Questions
What is CVE-2021-29486?
Which Cumulative distribution function versions are affected?
What version fixes CVE-2021-29486?
Is cumulative-distribution-function affected?
What is the CVSS score of CVE-2021-29486?
What CWE is associated with CVE-2021-29486?
How can I check npm dependencies for CVE-2021-29486?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-58qp-5328-v7mh",
"modified" : "2022-08-11T00:22:08Z",
"published" : "2021-05-04T17:43:36Z",
"aliases" : [ "CVE-2021-29486" ],
"summary" : "cumulative-distribution-function Infinite Loop vulnerability",
"details" : "### Impact\n\n* Apps using this library on improper data may crash or go into an infinite-loop\n* In the case of a nodejs server-app using this library to act on invalid non-numeric data, the nodejs server may crash. This may affect other users of this server and/or require the server to be rebooted for proper operation. \n* In the case of a browser app using this library to act on invalid non-numeric data, that browser may crash or lock up.\n\nA flaw enabling an infinite-loop was discovered in the code for evaluating the cumulative-distribution-function\nof input data. Although the documentation explains that numeric data is required, some users may confuse an array\nof strings like [\"1\",\"2\",\"3\",\"4\",\"5\"] for numeric data [1,2,3,4,5] when it is in fact string data. An infinite loop is possible when the \ncumulative-distribution-function is evaluated for a given point when the input data is string data rather than type `number`. \n\nThis vulnerability enables an infinite-cpu-loop denial-of-service-attack on any app using npm:cumulative-distribution-function v1.0.3 or earlier if the attacker can supply malformed data to the library. The vulnerability could also manifest if a data source to\nbe analyzed changes data type from Arrays of number (proper) to Arrays of string (invalid, but undetected by earlier version of the library).\n\n### Patches\n\nUsers should upgrade to at least v2.0.0, or the latest version.\n\nTests for several types of invalid data have been created, and version 2.0.0 has been tested to reject this invalid data by\nthrowing a `TypeError()` instead of processing it. Developers using this library may wish to adjust their app's code slightly to better tolerate or handle this TypeError. Apps performing proper numeric data validation before sending data to this library should be mostly unaffected by this patch. \n\n### Workarounds\n\nThe vulnerability can be mitigated in older versions by ensuring that only finite numeric data of type `Array[number]` or `number` is passed to `cumulative-distribution-function` and its `f(x)` function, respectively. \n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in the Github repository at https://github.com/DrPaulBrewer/cumulative-distribution-function",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "cumulative-distribution-function"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/DrPaulBrewer/cumulative-distribution-function/security/advisories/GHSA-58qp-5328-v7mh"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-29486"
}, {
"type" : "WEB",
"url" : "https://github.com/DrPaulBrewer/cumulative-distribution-function/issues/7"
}, {
"type" : "WEB",
"url" : "https://github.com/DrPaulBrewer/cumulative-distribution-function/pull/8"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/package/cumulative-distribution-function"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-835" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-04-30T17:36:06Z",
"nvd_published_at" : "2021-04-30T18:15:00Z"
}
}