Yargs, a lightweight option parsing library for Node.js applications, provides a simple way to handle command-line arguments. Versions 1.2.2 and 1.2.3 share a similar foundation, both offering straightforward parsing using an 'argv' hash without relying on complex optstrings. Developers using either version will find the core functionality consistent with dependencies like "minimist" to process the input.
However, the key difference lies in their release dates and potentially any bug fixes or minor internal improvements implemented between May 14th, 2014 (version 1.2.2) and June 13th, 2014 (version 1.2.3). For developers considering which version to utilize, opting for the slightly newer 1.2.3 is generally recommended, as it likely includes the most recent patches and refinements available at that point in time.
Both versions rely upon the same suite of development dependencies including chai, mocha, and hashish, so there would be no change in the overall toolchain. Furthermore, both packages are distributed under the MIT/X11 license and maintained by Alex Ford which means continuity in authorship and rights remain unaltered between the updates. Developers who require the most up-to-date option parsing capabilities should investigate the latest versions of yargs available on npm, as versions 1.2.2 and 1.2.3 are very old.
All the vulnerabilities related to the version 1.2.3 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).