Yargs is a lightweight npm package designed for parsing command-line arguments in Node.js applications. Versions 1.1.2 and 1.1.3 share a similar foundation, offering a simple way to convert command-line input into a usable JavaScript object (argv hash). Both versions rely on the "minimist" dependency for the core argument parsing functionality. The developer dependencies, essential for testing and development, remain unchanged between the two versions, including "chai" for assertions, "mocha" for testing framework, and "hashish". These versions are open-source, distributed under the MIT/X11 license, and maintained on GitHub, making it easy for developers to contribute and review the code. Alex Ford is credited as the author. The most notable distinction between version 1.1.2 and the slightly newer 1.1.3 lies in their release dates. Version 1.1.2 was released on February 14, 2014, while version 1.1.3 followed shortly after, on February 19, 2014. This suggests the newer version is likely to contain bug fixes or very minor improvements. For developers interested in using yargs, the consistent dependency on minimist indicates a stable parsing core, and the consistent author and license suggests continuity within these versions. The difference in release date likely accounts for subtle under-the-hood fixes and/or improvements to the library.
All the vulnerabilities related to the version 1.1.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).