CVE-2020-7598: Minimist Prototype Pollution Vulnerability
MODERATECVE-2020-7598 is a MODERATE (CVSS 5.6) prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Minimist libraries in the npm ecosystem. The issue involves prototype pollution in minimist. Remediation is available by upgrading affected packages to version 0.2.1, 1.2.3.
CVE-2020-7598 at a Glance
Security Impact
CVSS: 5.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L).
How to Fix CVE-2020-7598
To remediate this vulnerability, upgrade all affected Minimist dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install minimist@0.2.1
npm install minimist@1.2.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls minimist
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2020-7598, inspect your project dependencies using npm:
npm ls minimist
Analyze the terminal output to locate any version of Minimist in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.1), your application is affected.
Note: The npm ls minimist command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In Minimist, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2020-7598 Affected Minimist Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
minimist
|
npm |
< 0.2.1
|
0.2.1
|
|
minimist
|
npm |
≥ 1.0.0
< 1.2.3
|
1.2.3
|
References
Frequently Asked Questions
What is CVE-2020-7598?
Which Minimist versions are affected?
What version fixes CVE-2020-7598?
Is minimist affected?
What is the CVSS score of CVE-2020-7598?
What CWE is associated with CVE-2020-7598?
How can I check npm dependencies for CVE-2020-7598?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vh95-rmgr-6w4m",
"modified" : "2024-02-13T20:00:13Z",
"published" : "2020-04-03T21:48:32Z",
"aliases" : [ "CVE-2020-7598" ],
"summary" : "Prototype Pollution in minimist",
"details" : "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. \nParsing 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. \nThis is exploitable if attackers have control over the arguments being passed to `minimist`.\n\n\n## Recommendation\n\nUpgrade to versions 0.2.1, 1.2.3 or later.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "minimist"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.2.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "minimist"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.2.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-7598"
}, {
"type" : "WEB",
"url" : "https://github.com/minimistjs/minimist/commit/10bd4cdf49d9686d48214be9d579a9cdfda37c68"
}, {
"type" : "WEB",
"url" : "https://github.com/minimistjs/minimist/commit/38a4d1caead72ef99e824bb420a2528eec03d9ab"
}, {
"type" : "WEB",
"url" : "https://github.com/minimistjs/minimist/commit/4cf1354839cb972e38496d35e12f806eea92c11f#diff-a1e0ee62c91705696ddb71aa30ad4f95"
}, {
"type" : "WEB",
"url" : "https://github.com/minimistjs/minimist/commit/63e7ed05aa4b1889ec2f3b196426db4500cbda94"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/substack/minimist"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-MINIMIST-559764"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/1179"
}, {
"type" : "WEB",
"url" : "http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00024.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-04-03T21:42:08Z",
"nvd_published_at" : "2020-03-11T23:15:00Z"
}
}