Mocha 6.2.0 represents a modest but important update to the popular JavaScript testing framework, building upon the foundation of version 6.1.4. Both versions share the same core dependencies, ensuring stability in essential functionalities like assertion handling (chai), mocking (sinon), and asynchronous testing. However, the devil is in the details when assessing the differences and deciding when to upgrade.
The new version introduces several updated development dependencies, reflecting refinements in the testing and development workflow. Notably, updates to tools like eslint, nyc (code coverage), prettier (code formatting) and autoprefixer introduce improved code linting, broader ES module compatibility, better styling and formatting. Updating to newer versions of remark and remark-github might yield improved performance when rendering documentation and adhering to more recent language grammar. assetgraph-builder, markdown-it-anchor, @mocha/contributors, remark-inline-links, eslint-plugin-import, eslint-plugin-promise, eslint-config-prettier, eslint-plugin-prettier, eslint-config-semistandard have had small updates. Tools such as these help with automation and with the overall testing experience of the developer.
While the core testing logic remains consistent, these updated developer dependencies translate into subtle advantages. For example, newer versions of eslint and related plugins promote cleaner code and potentially identify bugs earlier. Also, more than 7000 bytes have been added to the unpacked size of the project, hinting to the addition of some new features under the hood.
Developers already using Mocha 6.1.4 will likely benefit from upgrading to 6.2.0. The update offers modern tooling enhancements and ensures compatibility with the latest JavaScript standards, contributing to a more streamlined and efficient development process.
All the vulnerabilities related to the version 6.2.0 of the package
Regular Expression Denial of Service in debug
Affected versions of debug
are vulnerable to regular expression denial of service when untrusted user input is passed into the o
formatter.
As it takes 50,000 characters to block the event loop for 2 seconds, this issue is a low severity issue.
This was later re-introduced in version v3.2.0, and then repatched in versions 3.2.7 and 4.3.1.
Version 2.x.x: Update to version 2.6.9 or later. Version 3.1.x: Update to version 3.1.0 or later. Version 3.2.x: Update to version 3.2.7 or later. Version 4.x.x: Update to version 4.3.1 or later.
Prototype Pollution in minimist
Affected versions of minimist
are vulnerable to prototype pollution. Arguments are not properly sanitized, allowing an attacker to modify the prototype of Object
, causing the addition or modification of an existing property that will exist on all objects.
Parsing the argument --__proto__.y=Polluted
adds a y
property with value Polluted
to all objects. The argument --__proto__=Polluted
raises and uncaught error and crashes the application.
This is exploitable if attackers have control over the arguments being passed to minimist
.
Upgrade to versions 0.2.1, 1.2.3 or later.
Prototype Pollution in minimist
Minimist prior to 1.2.6 and 0.2.4 is vulnerable to Prototype Pollution via file index.js
, function setKey()
(lines 69-95).
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.
yargs-parser Vulnerable to Prototype Pollution
Affected versions of yargs-parser
are vulnerable to prototype pollution. Arguments are not properly sanitized, allowing an attacker to modify the prototype of Object
, causing the addition or modification of an existing property that will exist on all objects.
Parsing the argument --foo.__proto__.bar baz'
adds a bar
property with value baz
to all objects. This is only exploitable if attackers have control over the arguments being passed to yargs-parser
.
Upgrade to versions 13.1.2, 15.0.1, 18.1.1 or later.
flat vulnerable to Prototype Pollution
flat helps flatten/unflatten nested Javascript objects. A vulnerability, which was classified as critical, was found in hughsk flat up to 5.0.0. This affects the function unflatten of the file index.js. The manipulation leads to improperly controlled modification of object prototype attributes ('prototype pollution'). It is possible to initiate the attack remotely. Upgrading to version 5.0.1 can address this issue. The name of the patch is 20ef0ef55dfa028caddaedbcb33efbdb04d18e13. It is recommended to upgrade the affected component. The identifier VDB-216777 was assigned to this vulnerability.