Yargs is a lightweight, command-line argument parsing library for Node.js, designed to simplify the process of building interactive command-line tools. Both version 1.0.4 and 1.0.5 share the same core functionality, providing a straightforward way to parse command-line arguments into an argv hash, eliminating the need for verbose optstrings.
These versions depend on minimist for the actual argument parsing and offer development dependencies like tap for testing and hashish for utility functions. They are released under the MIT/X11 license, promoting open-source use and modification. The library is maintained on a GitHub repository, allowing for community contributions and issue tracking.
The primary difference between versions 1.0.4 and 1.0.5 lies in their release date, with version 1.0.5 being released approximately 4 minutes after version 1.0.4 on November 23, 2013. This suggests that v1.0.5 is likely a patch release addressing some minor bugs or issue resolutions identified immediately after the initial release of v1.0.4. For developers, this means v1.0.5 represents the more stable and refined choice of the two.
While the changes may be incremental, upgrading to the latest patch version is generally recommended to leverage the most up-to-date and reliable code. The core API of Yargs in both versions remains consistent, ensuring that existing code using v1.0.4 will likely function without modification in v1.0.5.
All the vulnerabilities related to the version 1.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).