Yargs is a lightweight command-line argument parser for Node.js, designed to simplify the process of creating interactive command-line tools. Both versions 1.0.0 and 1.0.1 offer a straightforward way to parse arguments into an easily accessible argv hash, avoiding the complexities of traditional optstrings. This makes Yargs a great choice for developers looking for a simple yet effective solution.
The core functionality remains consistent across these two versions. Both rely on the "minimist" dependency for the underlying argument parsing, ensuring consistent behavior in how command-line inputs are processed. Developers can expect the same core API and usage patterns.
The primary difference between versions 1.0.0 and 1.0.1 lies in a minor update, potentially addressing bug fixes or small improvements. While the exact nature of the changes isn't explicitly detailed, the short five-minute gap between the release dates (2013-11-23T09:34:06.097Z vs 2013-11-23T09:39:47.210Z) suggests that the update was relatively small. For developers choosing between these two versions, upgrading to 1.0.1 is generally recommended due to the likelihood of stability improvements or minor bug resolutions. Both versions are MIT/X11 licensed.
All the vulnerabilities related to the version 1.0.1 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).