CVE-2021-29486

7.5 HIGH

📋 TL;DR

CVE-2021-29486 is a denial-of-service vulnerability in the cumulative-distribution-function npm library where passing string data instead of numeric arrays causes infinite loops. This affects any application using versions prior to 2.0.0, potentially crashing Node.js servers or browser applications. Attackers can exploit this by supplying malformed data to trigger CPU exhaustion.

💻 Affected Systems

Products:
  • cumulative-distribution-function npm package
Versions: All versions prior to 2.0.0
Operating Systems: All platforms running Node.js or browser JavaScript
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability manifests when string arrays are passed instead of numeric arrays, regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server crash requiring reboot, affecting all users of the service and potentially causing extended downtime.

🟠

Likely Case

Application crashes or becomes unresponsive when processing improperly validated user input containing string arrays.

🟢

If Mitigated

No impact if proper numeric validation is performed before data reaches the library.

🌐 Internet-Facing: HIGH - Web applications accepting user input without proper validation are vulnerable to DoS attacks.
🏢 Internal Only: MEDIUM - Internal applications could still crash if processing malformed data from internal sources.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires only sending string arrays to applications using the vulnerable library.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.0.0 and later

Vendor Advisory: https://github.com/DrPaulBrewer/cumulative-distribution-function/security/advisories/GHSA-58qp-5328-v7mh

Restart Required: Yes

Instructions:

1. Update package.json to specify 'cumulative-distribution-function': '^2.0.0'. 2. Run 'npm update cumulative-distribution-function'. 3. Restart the application.

🔧 Temporary Workarounds

Input validation wrapper

all

Implement strict numeric validation before passing data to the library

// JavaScript example: function validateNumericArray(arr) { return Array.isArray(arr) && arr.every(item => typeof item === 'number' && isFinite(item)); }

🧯 If You Can't Patch

  • Implement strict input validation to ensure only numeric arrays reach the library
  • Monitor application CPU usage and implement rate limiting on data processing endpoints

🔍 How to Verify

Check if Vulnerable:

Check package.json or package-lock.json for cumulative-distribution-function version <2.0.0

Check Version:

npm list cumulative-distribution-function

Verify Fix Applied:

Verify version is 2.0.0 or higher and test with string arrays to ensure TypeError is thrown

📡 Detection & Monitoring

Log Indicators:

  • Application crashes with infinite loop errors
  • High sustained CPU usage spikes
  • TypeError exceptions from cumulative-distribution-function

Network Indicators:

  • Repeated requests containing array data to vulnerable endpoints

SIEM Query:

source="application.log" AND ("infinite loop" OR "cumulative-distribution-function" OR "TypeError")

🔗 References

📤 Share & Export