Regular Expression Denial of Service (ReDoS) Affecting millisecond package, versions <0.1.2



    Attack Complexity Low

    Threat Intelligence

    EPSS 0.15% (51st percentile)
Expand this section
7.5 high
Expand this section
Red Hat
4.3 medium

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID npm:millisecond:20151120
  • published 25 Nov 2015
  • disclosed 20 Nov 2015
  • credit Luigi Pinca

How to fix?

Upgrade to version 0.1.2.


Regular expression Denial of Service (ReDoS) vulnerability exists in milliseconds module, affecting version 0.1.1 and below.

milliseconds, the milliseconds conversion utility is used to convert times to milliseconds. The regular expression used by the function to parse the time is vulnerable to denial of service attack, where extremely long strings that are passed to milliseconds() can take long time to process and as a result block the event loop for that period.


"The Regular expression Denial of Service (ReDoS) is a Denial of Service attack, that exploits the fact that most Regular Expression implementations may reach extreme situations that cause them to work very slowly (exponentially related to input size). An attacker can then cause a program using a Regular Expression to enter these extreme situations and then hang for a very long time." [1]