GHSA-58QP-5328-V7MH

Vulnerability from github – Published: 2021-05-04 17:43 – Updated: 2022-08-11 00:22
VLAI?
Summary
cumulative-distribution-function Infinite Loop vulnerability
Details

Impact

  • Apps using this library on improper data may crash or go into an infinite-loop
  • 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.
  • In the case of a browser app using this library to act on invalid non-numeric data, that browser may crash or lock up.

A flaw enabling an infinite-loop was discovered in the code for evaluating the cumulative-distribution-function of input data. Although the documentation explains that numeric data is required, some users may confuse an array of 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 cumulative-distribution-function is evaluated for a given point when the input data is string data rather than type number.

This 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 be analyzed changes data type from Arrays of number (proper) to Arrays of string (invalid, but undetected by earlier version of the library).

Patches

Users should upgrade to at least v2.0.0, or the latest version.

Tests for several types of invalid data have been created, and version 2.0.0 has been tested to reject this invalid data by throwing 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.

Workarounds

The 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.

For more information

If you have any questions or comments about this advisory: * Open an issue in the Github repository at https://github.com/DrPaulBrewer/cumulative-distribution-function

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "cumulative-distribution-function"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.0.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2021-29486"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-20",
      "CWE-835"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2021-04-30T17:36:06Z",
    "nvd_published_at": "2021-04-30T18:15:00Z",
    "severity": "HIGH"
  },
  "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\u0027s 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",
  "id": "GHSA-58qp-5328-v7mh",
  "modified": "2022-08-11T00:22:08Z",
  "published": "2021-05-04T17:43:36Z",
  "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"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "cumulative-distribution-function Infinite Loop vulnerability"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…