Minimist is a lightweight and versatile npm package designed for parsing command-line arguments, streamlining the process of creating command-line interfaces (CLIs). Both version 0.0.10 and 0.1.0 offer the same core functionality: parsing command-line options into a structured object, which makes it easier to access and use the arguments passed to your Node.js scripts. Developers can leverage minimist to define flags, handle boolean options, and manage key-value pairs from the command line. The library's MIT license permits flexible usage in various projects, and it benefits from having tape and tap as testing dependencies allowing for better quality releases.
The key difference between version 0.0.10 and the subsequent 0.1.0 lies primarily in internal refinements and possibly bug fixes, rather than significant feature additions. Examining the release dates reveals a minor gap, suggesting that the newer version addresses issues identified in the earlier one or incorporates minor improvements. Although not explicitly stated, developers upgrading from 0.0.10 to 0.1.0 could expect enhanced stability or performance. For new projects, the latest available version of minimist (beyond 0.1.0) is generally recommended to benefit from the most up-to-date improvements and security patches.
All the vulnerabilities related to the version 0.1.0 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).