Yargs is a lightweight command-line argument parsing library for Node.js, designed to simplify the process of building interactive command-line tools. Version 1.0.8 is a minor iteration over version 1.0.7, primarily distinguished by its release date. Published on December 6, 2013, it followed version 1.0.7, released on November 24, 2013, by approximately two weeks.
Both versions share identical core features: a minimalist approach to argument parsing, creating an argv hash for easy access to flag values. Both releases list minimist as a dependency ensuring reliable argument tokenization. Also tap and hashish are listed as devDependencies, useful for development and testing of the library itself. The license remains MIT/X11 in both versions, promoting open use and modification. The GitHub repository URL remains consistent, indicating a shared codebase history.
For developers, yargs offers a straightforward way to define and interpret command-line options without the complexities of extensive configuration. The library elegantly handles parsing arguments based on pre-defined rules, making developing command-line interfaces more accessible. While the differences between these specific versions are minor, they reflect ongoing maintenance and refinement within the yargs project. Each provides a solid base for parsing command arguments.
All the vulnerabilities related to the version 1.0.8 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).