Mocha versions 5.0.4 and 5.0.5 are both iterations of a popular JavaScript test framework designed for simple, flexible, and fun testing. Examining their metadata reveals subtle changes relevant to developers. Both versions share identical core dependencies, including libraries for handling HTML entities (he), calculating text differences (diff), file system path matching (glob), debugging (debug), system notifications (growl), directory creation (mkdirp), command-line argument parsing (commander), stream output (browser-stdout), color support (supports-color), and regular expression escaping (escape-string-regexp). This indicates that the fundamental testing functionalities remained consistent between these releases.
The devDependencies, used during development and testing of Mocha itself, are also identical. This suggests a shared set of tools for linting (eslint), code coverage (nyc, coveralls), browser testing (karma, browserify), and other tasks, ensuring a consistent development workflow.
The most notable differences reside in the dist section. Version 5.0.5 has a smaller unpacked size (772000 bytes) compared to 5.0.4 (852246 bytes), and a smaller file count (52 vs 54). This reduction in size could hint at optimizations in the codebase or removal of unnecessary files, potentially leading to slightly faster installation and reduced disk space usage, a welcome change for developers mindful of build times and dependency footprints. Furthermore, the release date indicates that version 5.0.5 was published more recently, suggesting it incorporates the latest fixes and improvements. While the core features remain the same, the refined size and recent release date of version 5.0.5 make it a slightly more appealing choice for new projects or updates.
All the vulnerabilities related to the version 5.0.5 of the package
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).