Yargs is a lightweight npm package designed for parsing command-line arguments and creating an argv hash, simplifying the process of accessing options without the complexity of optstrings. These two versions, 1.0.9 and 1.0.10, represent minor iterations of this tool, both sharing the same core description and functionality. Developers can leverage Yargs to easily extract and utilize command-line parameters within their Node.js applications.
Both versions depend on minimist ~0.0.1 for the foundational parsing logic and utilizes tap ~0.4.0 and hashish ~0.0.4 for development-related testing and perhaps manipulation of data structures, ensuring code quality and reliability. The MIT/X11 license allows for flexible usage and modification. The core author information remains the same between the versions from Alex Ford, building upon initial work "forked from James Halliday".
The key difference between versions 1.0.9 and 1.0.10 lies in their release date. Version 1.0.10 was published shortly after 1.0.9 (roughly 10 minutes) on December 12, 2013. This suggests a very rapid bug fix, refinement, or documentation update. For developers, this means that 1.0.10 likely includes minor improvements or fixes over 1.0.9, although the specific nature of these changes isn't detailed in the provided metadata. While both versions share the identical declared dependencies and devDependencies, developers would ideally opt for the slightly newer version (1.0.10) for the benefit of any possible subtle improvements or fixes.
All the vulnerabilities related to the version 1.0.10 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).