Minimist is a lightweight and versatile npm package designed for parsing command-line arguments. Both versions 0.0.9 and 0.0.10 share a core functionality: simplifying the process of extracting options and values from command-line inputs, making it easier for developers to build interactive and configurable command-line tools. The package utilizes a straightforward approach, enabling developers to define expected arguments and retrieve their corresponding values effortlessly.
While functionally quite similar, the update from version 0.0.9 to 0.0.10, released just three days later, indicates a minor update likely focused on bug fixes or small enhancements. Developers should review any changelogs or commit history in the Github repo to identify the exact modifications, as no specifics are provided in the provided data. Both versions include "tape" and "tap" as devDependencies, suggesting the package is tested using these frameworks. Minimist operates under the MIT license, allowing free use and modification. Developers utilize Minimist for creating command-line interfaces, scripting, and automating tasks where user input via arguments is required.
All the vulnerabilities related to the version 0.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).