Yargs is a lightweight option parsing library for Node.js applications, providing a streamlined approach to handling command-line arguments. Comparing versions 1.1.3 and 1.2.0, while the core functionality and dependencies (minimist ~0.0.1) remain consistent, some developers may find the upgrade worthwhile. Both versions maintain the same core structure, author, and license (MIT/X11).
The key difference lies in the release date. Version 1.2.0 was published on March 3, 2014, while version 1.1.3 came out on February 19, 2014.This slight temporal difference, indicates that version 1.2.0 incorporates any potential bug fixes, minor enhancements, or dependency updates (although not explicitly listed) addressed in the interim. Both versions are available on npm, downloadable via their respective tarball URLs. Developers relying on bleeding edge releases and smaller fixes, even unannounced ones, may prefer the newer version for its likely improved performance and stability. For applications already using yargs for option parsing, upgrading from 1.1.3 to 1.2.0 should be seamless. Since there are no changes in dependencies, upgrading shouldn't break existing code. It provides a stable solution for parsing commands.
All the vulnerabilities related to the version 1.2.0 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).